UIButton使用介绍
来源:互联网 发布:达拉斯2000年人口数据 编辑:程序博客网 时间:2024/06/07 04:11
self.addFan = [[UIButton alloc]initWithFrame:CGRectMake(498/2, 184/2, 120/2-1, 48/2)];
self.addFan.backgroundColor = [UIColor clearColor];
//按钮背景图
[self.addFan setBackgroundImage:[UIImage imageNamed:@"Click-the-button-is-not.png"] forState:UIControlStateNormal];
//按钮文字颜色
[self.addFan setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
//按钮文字类型大小
[self.addFan.titleLabel setFont: [UIFont systemFontOfSize: 10.0]];
//按钮文字内容
[self.addFan setTitle:@"关注" forState:UIControlStateNormal];
//按钮文字的偏移位置
[self.addFan setTitleEdgeInsets:UIEdgeInsetsMake(13/2,5, 13/2, 0)];
//按钮图片
[self.addFan setImage:[UIImage imageNamed:@"Attention-symbol.png"] forState:UIControlStateNormal];
//按钮图片偏移位置
[self.addFan setImageEdgeInsets:UIEdgeInsetsMake(15/2,28/2, 15/2, 120/2-1-18/2-28/2)];
[self.addFan addTarget:self action:@selector(addFan:) forControlEvents:UIControlEventTouchUpInside];
[self addSubview:self.addFan];
self.addFan.backgroundColor = [UIColor clearColor];
//按钮背景图
[self.addFan setBackgroundImage:[UIImage imageNamed:@"Click-the-button-is-not.png"] forState:UIControlStateNormal];
//按钮文字颜色
[self.addFan setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
//按钮文字类型大小
[self.addFan.titleLabel setFont: [UIFont systemFontOfSize: 10.0]];
//按钮文字内容
[self.addFan setTitle:@"关注" forState:UIControlStateNormal];
//按钮文字的偏移位置
[self.addFan setTitleEdgeInsets:UIEdgeInsetsMake(13/2,5, 13/2, 0)];
//按钮图片
[self.addFan setImage:[UIImage imageNamed:@"Attention-symbol.png"] forState:UIControlStateNormal];
//按钮图片偏移位置
[self.addFan setImageEdgeInsets:UIEdgeInsetsMake(15/2,28/2, 15/2, 120/2-1-18/2-28/2)];
[self.addFan addTarget:self action:@selector(addFan:) forControlEvents:UIControlEventTouchUpInside];
[self addSubview:self.addFan];
- UIButton使用介绍
- UIButton 使用
- 使用UIButton
- iOS UIButton详细介绍
- UIButton简单介绍
- UIButton的详细介绍:
- UIButton常用属性介绍lzp
- UIButton详细的属性介绍
- UIButton创建不能使用UIButton alloc
- UIButton的使用
- iphone开发 UIButton使用
- UIButton的使用
- UIButton 使用全面解析
- iphone开发 UIButton使用
- UIButton 使用的感受
- UIButton使用详解
- UIButton 使用全面解析
- UIButton使用状态
- C语言深度解剖读书笔记(1.关键字的秘密)
- Metro中listbox点击后整个背景不变色
- Linux虚拟内存(VM)相关参数解析
- javascript深入理解js闭包
- Neumann boundary条件的实现
- UIButton使用介绍
- 重新验证先前的假设和评估风险的机会
- VS2010程序打包操作(超详细的)
- 十道海量数据处理面试题与十个方法大总结
- Eclipse 编辑xml文件时,没有提示
- SVN remains in conflict?
- QTableWidget中checkBox状态判断
- 小菜鸟学Spring-读取属性文件值(三)
- Matlab中pdist 函数详解(各种距离的生成)