摘要: UIButton特点既能显示文字,又能显示图片(能显示2张图片,背景图片、内容图片)长按高亮的时候可以切换图片\文字直接通过addTarget...方法监听点击 UIImageView能显示图片,不能直接通过addTarget...方法监听点击 UILabel能显示文字,不能直接通过addTarge 阅读全文
posted @ 2016-11-12 22:56 iFat 阅读(146) 评论(0) 推荐(0) 编辑
摘要: - (void)viewDidLoad { [super viewDidLoad]; // 1.1 创建按钮对象 // UIButton *button = [[UIButton alloc] init]; // 注意:设置按钮的类型只能在初始化的时候设置 -> UIButtonTypeCustom UIButton *button = [UIButton... 阅读全文
posted @ 2016-11-12 22:40 iFat 阅读(204) 评论(0) 推荐(0) 编辑
摘要: - (void)setTitle:(NSString *)title forState:(UIControlState)state;设置按钮的文字 - (void)setTitleColor:(UIColor *)color forState:(UIControlState)state;设置按钮的文 阅读全文
posted @ 2016-11-12 20:35 iFat 阅读(152) 评论(0) 推荐(0) 编辑
摘要: 设置按钮在不同状态下的背景图片(为了保证高亮状态下的图片正常显示,必须设置按钮的type为custom) 阅读全文
posted @ 2016-11-12 20:23 iFat 阅读(350) 评论(0) 推荐(0) 编辑
摘要: 实际上,UIButton自带了很多种不同的样式 在用代码创建按钮的同时指定按钮样式UIButton *btn = [UIButton buttonWithType:UIButtonTypeCustom]; UIButtonTypeCustom:无类型,按钮的内容需要自定义UIButtonTypeDe 阅读全文
posted @ 2016-11-12 20:09 iFat 阅读(199) 评论(0) 推荐(0) 编辑
摘要: normal(普通状态) 默认情况(Default) 对应的枚举常量:UIControlStateNormal highlighted(高亮状态)按钮被按下去的时候(手指还未松开)对应的枚举常量:UIControlStateHighlighted disabled(失效状态,不可用状态)如果enab 阅读全文
posted @ 2016-11-12 20:00 iFat 阅读(495) 评论(0) 推荐(0) 编辑
摘要: 还有一个非常重要的UI控件 UIButton,俗称“按钮”一般情况下,点击某个控件后,会做出相应反应的都是按钮按钮的功能比较多,既能显示文字,又能显示图片,还能随时调整内部图片和文字的位置 阅读全文
posted @ 2016-11-12 19:56 iFat 阅读(579) 评论(0) 推荐(0) 编辑
摘要: 图标下载网站 http://www.easyicon.net/ 阅读全文
posted @ 2016-11-12 15:50 iFat 阅读(1369) 评论(0) 推荐(0) 编辑