草庐IT

UIBUTTON

全部标签

ios - 为什么 UIButton 不响应触摸?

我看了很多回复,还是想不通。我知道第一行有点奇怪,但这是因为它继承自将标题View设置为搜索栏的父类(superclass)searchBar=(UISearchBar*)self.tableView.tableHeaderView;[[searchBar.subviewsobjectAtIndex:0]removeFromSuperview];UILabel*label=[[UILabelalloc]initWithFrame:CGRectMake(0,-100,self.view.frame.size.width,100)];label.text=@"AAAA";[searchBa

ios - 如何找回 iOS 7 中的 UIButton 边框?

我在iOSSDK6.1inXcode5中构建了一个旧项目.但是,当应用程序在运行iOS7的iPhone上运行时,UIbutton是无边界的。我检查过.xib是“Buildsfor”>“ProjectDeploymentTarget(5.0)”:我如何配置Xcode5来构建项目以显示iOS6.1风格的UIButton? 最佳答案 试试这个使用QuartzCore框架设置按钮的边框宽度#importbutton.layer.borderWidth=1.0f;button.layer.borderColor=[[UIColorblackC

ios - 如何找回 iOS 7 中的 UIButton 边框?

我在iOSSDK6.1inXcode5中构建了一个旧项目.但是,当应用程序在运行iOS7的iPhone上运行时,UIbutton是无边界的。我检查过.xib是“Buildsfor”>“ProjectDeploymentTarget(5.0)”:我如何配置Xcode5来构建项目以显示iOS6.1风格的UIButton? 最佳答案 试试这个使用QuartzCore框架设置按钮的边框宽度#importbutton.layer.borderWidth=1.0f;button.layer.borderColor=[[UIColorblackC

ios - 自定义 UITableViewCell,单元格中的按钮不起作用

我有一个UITableViewController,我在其中使用自定义UITableViewCell。该单元格包含图像、标签和按钮。除按钮外,一切都按预期工作。按下按钮时,没有任何反应。只有单元格被选中。我在IB中建立了从按钮到自定义TweetTableViewCell类的连接。@property(weak,nonatomic)IBOutletUIButton*cellFollowButton;-(IBAction)followButtonTappedonCell:(id)sender;我正在followButtonTappedonCell操作中向控制台写入一些文本。但是当按下按钮时,

ios - 自定义 UITableViewCell,单元格中的按钮不起作用

我有一个UITableViewController,我在其中使用自定义UITableViewCell。该单元格包含图像、标签和按钮。除按钮外,一切都按预期工作。按下按钮时,没有任何反应。只有单元格被选中。我在IB中建立了从按钮到自定义TweetTableViewCell类的连接。@property(weak,nonatomic)IBOutletUIButton*cellFollowButton;-(IBAction)followButtonTappedonCell:(id)sender;我正在followButtonTappedonCell操作中向控制台写入一些文本。但是当按下按钮时,

ios - UITableViewCell 中的 UIButton 从 UITableView 窃取触摸

我有一个类似于thisone的问题但提供的答案并没有多大帮助。我有UITableView和一些自定义UITableViewCells,这些单元格有一些嵌套的自定义UIViews,最后还有一些UIButtons。正如上面提到的问题,问题是当我触摸我的按钮时,触摸事件不会填充到UITableView并且它永远不会滚动。这是一些代码(这是最快的重现方式,不是我的实际代码):@interfaceViewController:UIViewController@property(strong,nonatomic)IBOutletUITableView*tableView;@end@implemen

ios - UITableViewCell 中的 UIButton 从 UITableView 窃取触摸

我有一个类似于thisone的问题但提供的答案并没有多大帮助。我有UITableView和一些自定义UITableViewCells,这些单元格有一些嵌套的自定义UIViews,最后还有一些UIButtons。正如上面提到的问题,问题是当我触摸我的按钮时,触摸事件不会填充到UITableView并且它永远不会滚动。这是一些代码(这是最快的重现方式,不是我的实际代码):@interfaceViewController:UIViewController@property(strong,nonatomic)IBOutletUITableView*tableView;@end@implemen

ios - 文本不适合特定字体的 UIButton titleLabel 高度

我在使用特定字体时遇到了一些问题。它是为学校设计的,所以A和Å的高度不同。我认为这给我的UIButtons带来了麻烦。我试图解决它,但似乎无法解决问题。这是我最后尝试过的:[selfsetValue:[UIFontfontWithName:@"fontname"size:220]forKeyPath:@"button1.font"];[selfsetValue:[UIFontfontWithName:@"fontname"size:220]forKeyPath:@"button2.font"];[selfsetValue:[UIFontfontWithName:@"fontname"s

ios - 文本不适合特定字体的 UIButton titleLabel 高度

我在使用特定字体时遇到了一些问题。它是为学校设计的,所以A和Å的高度不同。我认为这给我的UIButtons带来了麻烦。我试图解决它,但似乎无法解决问题。这是我最后尝试过的:[selfsetValue:[UIFontfontWithName:@"fontname"size:220]forKeyPath:@"button1.font"];[selfsetValue:[UIFontfontWithName:@"fontname"size:220]forKeyPath:@"button2.font"];[selfsetValue:[UIFontfontWithName:@"fontname"s

ios - UIButton -setTitle : forState: doesn't seem to work

我正在尝试动态更新UIButton的IBOutletCollection的标题。我希望标题设置为选中时字母“S”和禁用和选中时的文本“D|S”。它不工作,所以我打印了titleForState:,看起来标题没有正确设置。我是否正确使用了setTitle:forState:?@property(strong,nonatomic)IBOutletCollection(UIButton)NSArray*buttons;...-(void)updateUI//CallingthisfromIBAction{for(UIButton*buttoninself.buttons){[buttonse