没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
UIButton :
一、步骤:
1、初始化 创建 (设定位置) 2、颜色(默认白色) 3、release 管理内存
二、样式包括:
1、背景色 2、大小 3、边框(颜色、宽度) 4、边框颜色 5、圆角 6、阴影 (阴影颜色范围)
7、设置成圆 8、高亮特效 9.按钮文本 (字体大小、颜色、位置、) 10、添加方法
(注:在iOS开发中,任何可见视图都是继承于UIView的。 继承体系中,大部分UIView的属性适用于其任何孩子。
UIView,UIButton,UIImageView等设立圆角,设置阴影,设置边框的方法
而UIView的layer属性可以绘制UIView的各种效果。其实我们看到的View的动画实际上也是layer在绘制。)
注意layer的使用。。。
参考:
http://blog.csdn.net/like7xiaoben/article/details/7588551 // 进阶版本 有补充
http://www.cnblogs.com/ios8/p/ios-uibutton.html // 进阶版本 有补充
http://www.cnblogs.com/ygm900/archive/2013/05/28/3104169.html
http://blog.csdn.net/jb80400812/article/details/6614184 // NB
创建:
第一、UIButton的定义
1、创建 然后设置格式
UIButton *signBtn = [UIButton buttonWithType:UIButtonTypeCustom];
signBtn.frame = CGRectMake(0, 0, 80, 40);
2、创建和设定位置合并一句
UIButton *but1 = [[UIButton alloc] initWithFrame:CGRectMake(97.5,103.5,200,85)]
UIButton *button=[[UIButton buttonWithType:(UIButtonType);
能够定义的button类型有以下6种,
一、步骤:
1、初始化 创建 (设定位置) 2、颜色(默认白色) 3、release 管理内存
二、样式包括:
1、背景色 2、大小 3、边框(颜色、宽度) 4、边框颜色 5、圆角 6、阴影 (阴影颜色范围)
7、设置成圆 8、高亮特效 9.按钮文本 (字体大小、颜色、位置、) 10、添加方法
(注:在iOS开发中,任何可见视图都是继承于UIView的。 继承体系中,大部分UIView的属性适用于其任何孩子。
UIView,UIButton,UIImageView等设立圆角,设置阴影,设置边框的方法
而UIView的layer属性可以绘制UIView的各种效果。其实我们看到的View的动画实际上也是layer在绘制。)
注意layer的使用。。。
参考:
http://blog.csdn.net/like7xiaoben/article/details/7588551 // 进阶版本 有补充
http://www.cnblogs.com/ios8/p/ios-uibutton.html // 进阶版本 有补充
http://www.cnblogs.com/ygm900/archive/2013/05/28/3104169.html
http://blog.csdn.net/jb80400812/article/details/6614184 // NB
创建:
第一、UIButton的定义
1、创建 然后设置格式
UIButton *signBtn = [UIButton buttonWithType:UIButtonTypeCustom];
signBtn.frame = CGRectMake(0, 0, 80, 40);
2、创建和设定位置合并一句
UIButton *but1 = [[UIButton alloc] initWithFrame:CGRectMake(97.5,103.5,200,85)]
UIButton *button=[[UIButton buttonWithType:(UIButtonType);
能够定义的button类型有以下6种,
typedef enum {
UIButtonTypeCustom = 0, 自定义风格
UIButtonTypeRoundedRect, 圆角矩形
UIButtonTypeDetailDisclosure, 蓝色小箭头按钮,主要做详细说明用
UIButtonTypeInfoLight, 亮色感叹号
UIButtonTypeInfoDark, 暗色感叹号
UIButtonTypeContactAdd, 十字加号按钮
} UIButtonType;
第二、state状态
forState: 这个参数的作用是定义按钮的文字或图片在何种状态下才会显现
enum {
UIControlStateNormal = 0, 常规状态显现
UIControlStateHighlighted = 1 << 0, 高亮状态显现
UIControlStateDisabled = 1 << 1, 禁用的状态才会显现
UIControlStateSelected = 1 << 2, 选中状态
UIControlStateApplication = 0x00FF0000, 当应用程序标志时
UIControlStateReserved = 0xFF000000 为内部框架预留,可以不管他
};
第三、设置button填充图片和背景图片
[buttonsetImage:[UIImageimageNamed:@"checkmarkControllerIcon"]forState:UIControlStateNormal];
[buttonsetBackgroundImage:[UIImageimageNamed:@"checkmarkControllerIcon"]forState:UIControlStateNormal];
UIButtonTypeCustom = 0, 自定义风格
UIButtonTypeRoundedRect, 圆角矩形
UIButtonTypeDetailDisclosure, 蓝色小箭头按钮,主要做详细说明用
UIButtonTypeInfoLight, 亮色感叹号
UIButtonTypeInfoDark, 暗色感叹号
UIButtonTypeContactAdd, 十字加号按钮
} UIButtonType;
第二、state状态
forState: 这个参数的作用是定义按钮的文字或图片在何种状态下才会显现
enum {
UIControlStateNormal = 0, 常规状态显现
UIControlStateHighlighted = 1 << 0, 高亮状态显现
UIControlStateDisabled = 1 << 1, 禁用的状态才会显现
UIControlStateSelected = 1 << 2, 选中状态
UIControlStateApplication = 0x00FF0000, 当应用程序标志时
UIControlStateReserved = 0xFF000000 为内部框架预留,可以不管他
};
第三、设置button填充图片和背景图片
[buttonsetImage:[UIImageimageNamed:@"checkmarkControllerIcon"]forState:UIControlStateNormal];
[buttonsetBackgroundImage:[UIImageimageNamed:@"checkmarkControllerIcon"]forState:UIControlStateNormal];
剩余5页未读,继续阅读
资源评论
安静的丑男子
- 粉丝: 0
- 资源: 3
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功