草庐IT

button_sent

全部标签

ios - 如何根据Button的Title将autoSize设置为UIbutton?

我有按钮。为了获得按钮的标题,我向服务器发送请求,然后设置按钮的标题。现在我需要将自动调整大小设置为此按钮。这个怎么做?我在按钮的身份检查器的换行符中设置为CharacterWrap。现在文本显示为多行,但我还需要调整按钮的大小,因为有些文本太大而有些太小。这是它在Storyboard中的样子和带有约束的约束,一切正常,我只需要调整按钮的大小。importUIKit@IBDesignableclassButtonTableViewCell:UITableViewCell{@IBInspectablevarselectedColor:UIColor=UIColor.init(red:34

ios - 来自 UIBarButtonItem 的 "unrecognized selector sent to instance"

我知道这个问题已经被问过很多次了。但我似乎无法克服这个错误。我使用ObjectiveC在我的应用程序的早期版本中运行它。下面的两个方法都在同一个UIViewController中。ViewController还作为RootViewController的引用,是UINavigationController的一部分。funcloadEditView(sender:AnyObject,animated:Bool=true){vareditViewController:EditViewController=EditViewController()//setsomestuffupself.nav

ios - 获取错误 [UIImage 范围] : unrecognized selector sent to instance

我正在尝试对我的UIImageView应用径向模糊,但是当我尝试这样做时出现错误[UIImageextent]:unrecognizedselectorsenttoinstance我使用的代码来自以下示例:https://developer.apple.com/documentation/coreimage/selectively_focusing_on_an_imageleth=bgImage.image!.size.heightletw=bgImage.image!.size.widthguardletradialMask=CIFilter(name:"CIRadialGradie

ios - "unrecognized selector sent to instance" swift

我没有收到任何错误或任何错误,但是当我运行该应用程序时它崩溃了。我得到的日志是“由于未捕获的异常‘NSInvalidArgumentException’而终止应用程序,原因:‘-[MPConcreteMediaItemimageWithSize:]:无法识别的选择器发送到实例0x14eefa3b0’”。我认为导致这个问题的是这一行:cell?.imageView?.image=sortedResults[indexPath.row].imageWithSize(imageSize)因为当我删除它/取消注释时,一切正常。imageSize是一个CGSize变量。整个代码:letstart

ios - UISwipeGesture 'unrecognized selector sent to instance'

如果有人能帮我解决这个问题,那就太好了!我花了几个小时试图修复,但没有成功错误...2016-06-2320:30:43.341057ScalingRings[408:38903][DYMTLInitPlatform]platforminitializationsuccessful2016-06-2320:30:43.750822ScalingRings[408:38776]MetalGPUFrameCaptureEnabled2016-06-2320:30:43.751531ScalingRings[408:38776]MetalAPIValidationEnabled2016-06

ios - swift : Hide button in subview

我试图在触发函数时在subview中隐藏UIButton。我对该层次结构有多个View:vartakePhotoButton:UIButton=UIButton.buttonWithType(UIButtonType.System)asUIButtontakePhotoButton.addTarget(self,action:"takePhoto",forControlEvents:UIControlEvents.TouchUpInside)varsavePhotoButton:UIButton=UIButton.buttonWithType(UIButtonType.System)a

ios - swift 3 : Get distance of button to bottom of screen

我想在Swift3中获取按钮到屏幕底部的距离。当我查看距离(alt键)时,我可以在Storyboard中看到正确的值,但遗憾的是我无法手动计算它。我正在寻找的值与按钮​​的“垂直间距到底部布局”约束中的常量相同。view.frame.maxY-randomButton.frame.maxY给我的值(value)太高了。 最佳答案 view.frame.size.height-(button.frame.size.height+button.frame.origin.y)我觉得还行!希望对你有帮助

macos - [NSSearchField 对象] : unrecognized selector sent to instance

我正在一个简单的Mac应用程序中测试Swift。我在Storyboard中得到了一个NSToolbar并在里面画了一个NSSearchfield。NSSearchfiled连接到第一响应者的方法controlTextDidChange(第一响应者是我添加了NSTextFieldDelegate的ViewController)。这是方法:@IBActionoverridefunccontrolTextDidChange(obj:NSNotification!){println("searching...")println(obj.object.stringValue)}每次搜索新角色时都

Swift tableview Cell label change Text by button 标签

我在tableview单元格上创建了​​一个按钮和两个标签,当单击按钮时然后更改tableview标签文本这是我的代码funcbuttonLike_ww(sender:AnyObject?){vartag:NSInteger=sender!.tag;tag_last_button_clicked=tag;//foundtableletcell=TableViewCell_trandingjive(style:UITableViewCellStyle.Default,reuseIdentifier:"Cell")cell.label_dislike.text="20"cell.label

ios - 另一个 "unrecognized selector sent to instance"

Edit3:Forotherpeoplegettingthiserror,thisiswhathappenedhere.IoriginallycreatedtheIBActionfortheslideras"numberOfSounds".Ithencreatedaclasspropertycalled"numberOfSounds"andrenamedtheIBActionto"sliderValueChanged".Iexpectedtheconnectiontoautomaticallyupdatetheconnection,BUTITDOESN'T.So,sinceIdumbl