UIButton状态
2015-12-03 10:07
501 查看
UIButton状态:
UIControlStateNormal // 正常状态
UIControlStateHighlighted // 高亮状态
UIControlStateDisabled // 禁用状态
UIControlStateSelected // 选中状态
UIControlStateApplication //
UIControlStateReserved // 保留状态
UIButton类型:
UIButtonTypeCustom //自定义类型
UIButtonTypeRoundedRect
//圆角类型v
UIButtonTypeDetailDisclosure
//细节展示按钮
UIButtonTypeInfoLight
//浅色背景的信息按钮
UIButtonTypeInfoDark
//暗色背景的信息按钮
UIButtonTypeContactAdd
// 添加按钮 www.2cto.com
创建UIButton
1. UIButton *button = [[UIButton alloc] initWithFrame: CGRectMake (x, y, Width, Height)];
2. UIButton *button = [[UIButton buttonWithType:UIButtonTypeCustom] retain];
3,设置UIButton标题 [button setTitle:title forState:UIControlStateNormal];
4,设置UIButton标题颜色 [button setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
5,设置UIButton背景图片 [button setBackgroundImage:newImage forState:UIControlStateNormal];
6,设置UIButton背景颜色 button.backgroundColor = [UIColor clearColor];
UIControlStateNormal // 正常状态
UIControlStateHighlighted // 高亮状态
UIControlStateDisabled // 禁用状态
UIControlStateSelected // 选中状态
UIControlStateApplication //
UIControlStateReserved // 保留状态
UIButton类型:
UIButtonTypeCustom //自定义类型
UIButtonTypeRoundedRect
//圆角类型v
UIButtonTypeDetailDisclosure
//细节展示按钮
UIButtonTypeInfoLight
//浅色背景的信息按钮
UIButtonTypeInfoDark
//暗色背景的信息按钮
UIButtonTypeContactAdd
// 添加按钮 www.2cto.com
创建UIButton
1. UIButton *button = [[UIButton alloc] initWithFrame: CGRectMake (x, y, Width, Height)];
2. UIButton *button = [[UIButton buttonWithType:UIButtonTypeCustom] retain];
3,设置UIButton标题 [button setTitle:title forState:UIControlStateNormal];
4,设置UIButton标题颜色 [button setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
5,设置UIButton背景图片 [button setBackgroundImage:newImage forState:UIControlStateNormal];
6,设置UIButton背景颜色 button.backgroundColor = [UIColor clearColor];
相关文章推荐
- easyui-messager消息窗口组件
- 设置UIImage的渲染模式
- iOS UISearchBar修改placeholder字体颜色和大小
- Android Volley 之自定义Request
- Android Volley完全解析(三),定制自己的Request
- iOS的UI开发中UITabBarControlle的基本使用教程
- Selenium webdriver-UI Element定位
- Hprose question
- C#中Request.servervariables参数
- torque 安装排错
- Unigui unidbgrid+unidac uniquery联合使用时产生的奇葩问题
- [SoapUI] 通过Groovy Script获取当前运行的是哪套Environment
- leetcode之Range Sum Query 2D - Immutable
- Machine Learning week 9 quiz: Recommender Systems
- 检测到有潜在危险的 Request.Form 值
- 255. Verify Preorder Sequence in Binary Search Tree
- Parquet_2. 在 Impala/Hive 中使用 Parquet 格式存储数据
- Parquet_1. 使用谓词下推和映射来优化 Job
- UOJ UER#5 A 万圣节的南瓜灯
- UOJ UER#5 A 万圣节的南瓜灯