【iOS】UIButton 常用属性
2016-06-13 15:00
405 查看
发现 UIButton 的相关属性不熟悉了……常用的一些属性代码如下:
效果如图所示:
UIButton *add = [UIButton buttonWithType:UIButtonTypeCustom]; add.frame = CGRectMake(WIDTH-80, 20, 60, 30); add.layer.masksToBounds = YES; add.layer.cornerRadius = 8.0; add.layer.borderWidth = 1.0; //边框宽度 add.backgroundColor = [UIColor whiteColor]; // add.titleLabel.backgroundColor = [UIColor blueColor]; [add setTitle:@"Add" forState:UIControlStateNormal]; [add setTitleColor:[UIColor blueColor] forState:UIControlStateNormal]; [self.view addSubview:add]; [add addTarget:self action:@selector(addSth) forControlEvents:UIControlEventTouchUpInside];
效果如图所示:
相关文章推荐
- 如何通过java代码对kylin进行cube build
- 可扩展的事件复用技术:epoll和kqueue
- ReflectUitls类的编写和对反射机制的解析
- 多线程 - 阻塞队列blockingQueue用法
- hdu1005 Number Sequence
- java quick guide
- kendo ui简介
- Value stored to 'recordView' during its initialization is never read
- UINavigationBar颜色设置 用色码设置有误差
- 点击UITableviewCell中的Button打印cell属于的section和row
- JavaServer Faces 2.2 requires Dynamic Web Module 2.5 or newer
- confluence-5.4.4安装、破解、汉化
- Failed to create 'build\outputs\apk\watch-debug-unaligned.apks': 拒绝访问。
- 解决UITexFiled,UITableView与手势冲突
- 命名空间中的“MvcBuildViews”。 无效
- HADOOP- BUILD FAILURE
- uitableview grouped 顶端多出一块
- [leetcode] 357. Count Numbers with Unique Digits 解题报告
- UIFont 字体大全
- Count Numbers with Unique Digits