![](https://img-blog.csdnimg.cn/20201014180756780.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
UIButton
BearsG
即便你一贫如洗,我就是你最后的行李
展开
-
UIButton内文字自适应button长度
UIButton * bu =[UIButton buttonWithType:UIButtonTypeCustom];bu.titleLabel.adjustsFontSizeToFitWidth = YES;原创 2016-04-05 16:57:26 · 15088 阅读 · 0 评论 -
UIButton基本属性及定义
第一、UIButton的定义 UIButton *button=[[UIButton buttonWithType:(UIButtonType); 能够定义的button类型有以下6种, typedef enum { UIButtonTypeCustom = 0, 自定义风格 UIButtonTypeRoundedRect, 圆角矩形 UIButtonTypeDetailDisc原创 2016-04-06 11:06:22 · 973 阅读 · 0 评论 -
UIButton获取标题文字
问题 一个button,点击事件实现在一个搜索图标和“取消”之间的转换,那需要在响应事件中判断标题文字,所以我想获取button的标题 代码如下: if ([button.titleLabel.text isEqualToString:@"取消"]) { [button setTitle:@""forState:UIControlStateNormal]; }else原创 2016-09-14 15:56:40 · 8601 阅读 · 0 评论 -
UIButton 的setimage 图片的颜色是蓝色
第一个图: [self.btn setImage: [UIImage imageNamed:@"cramera.png"] forState:UIControlStateNormal];第二个图: [self.btn2 setBackgroundImage: [UIImage imageNamed:@"cramera.png"] forState:UIControlStateNorma原创 2016-11-03 09:19:20 · 8191 阅读 · 1 评论 -
button 设置圆角、View设置圆角以及Button图文位置
有些常用的属性有时候会突然忘了,忘一次写一次UIButton *roundBtn = [UIButton buttonWithType:UIButtonTypeCustom];roundBtn.frame = CGRectMake(100, 100, 50, 50);roundBtn.backgroundColor = [UIColor redColor//设置cornerRadius_roundB原创 2016-06-12 17:23:20 · 3089 阅读 · 0 评论 -
iOS UIButton各类属性设置大全
基本属性设置自定义的按钮UIButton *button1=[UIButton buttonWithType:UIButtonTypeCustom];设置一个圆角的按钮UIButton *button1=[UIButton buttonWithType:UIButtonTypeRoundedRect];按钮的位置坐标button1.frame=CGRectMake(80,250,250,原创 2016-05-27 17:15:02 · 2517 阅读 · 0 评论