UIButton 设置圆角 边框颜色 点击回调方法
UIButton *signBtn = [UIButton buttonWithType:UIButtonTypeCustom];
signBtn.frame = CGRectMake(, , , );
[signBtn.layer setMasksToBounds:YES];
[signBtn.layer setCornerRadius:10.0]; //设置矩形四个圆角半径
[signBtn.layer setBorderWidth:1.0]; //边框宽度
CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceRGB();
CGColorRef colorref = CGColorCreate(colorSpace,(CGFloat[]){ , , , }); [signBtn.layer setBorderColor:colorref];//边框颜色 [signBtn setTitle:@"还 原" forState:UIControlStateNormal];//button title [signBtn setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];//title color [signBtn addTarget:self action:@selector(buttonDonwRecover:) forControlEvents:UIControlEventTouchUpInside];//button 点击回调方法 signBtn.backgroundColor = [UIColor whiteColor]; - (void)buttonDonwRecover:(id)sender
{
UIButton *btn = (UIButton *)sender;
}
UIButton 设置圆角 边框颜色 点击回调方法的更多相关文章
- iOS开发--UIButton 设置圆角 边框颜色 点击回调方法
UIButton *signBtn = [UIButton buttonWithType:UIButtonTypeCustom]; signBtn.frame = CGRectMake(, , , ) ...
- UIButton设置圆角和边框及边框颜色
1. 按钮边框颜色 //设置边框颜色 [btn.layer setMasksToBounds:YES]; [btn.layer setCornerRadius:10.0]; //设置矩形四个圆角半径 ...
- Border-radius属性--设置圆角边框
border-radius:该属性允许您为元素添加圆角边框! div { border:2px solid; border-radius:25px; -moz-border-radius:25px; ...
- swift设置textfield边框颜色
//swift3.0,如果是2.0的话也可以照着这个样子去写,语法有所变动.根据联想出来的就可以了. let tx = UITextField(frame: CGRect(x: 100, y: 100 ...
- iOS UITextView 设置圆角边框线
textView.layer.borderColor = UIColor.lightGray.cgColor textView.layer.cornerRadius = 4 textView.laye ...
- 通过CSS给图像设置圆角边框
<html> <style> .smaller-image{ border-radius: 50%; width: 100px; } </style> <bo ...
- iOS之用xib给控件设置圆角、边框效果
xib中为各种控件设置圆角 通过代码的方式设置 @interface ViewController () @property (weak, nonatomic) IBOutlet UIView *my ...
- JAVA swing中JPanel如何实现分组框的效果以及设置边框颜色 分类: Java Game 2014-08-16 12:21 198人阅读 评论(0) 收藏
代码如下: import java.awt.FlowLayout; import java.awt.Frame; import java.awt.GridLayout; import javax.sw ...
- iOS UIView设置圆角
UIView设置圆角 1.比较简单的情况,UIView四个角都是圆角: UIView *aView = [[UIView alloc] init]; aView.frame = CGRectMake( ...
随机推荐
- 如何将svg图标快速转换成字体图标?
今天遇到一个客户需要我将页面的图标做成字体图标,想想哎可能整的麻烦,不过想想这也是对项目的一个优化 ( 1.字体图标直接用color自由控制颜色:2.整合在一起,减少http请求等 PS:平时 ...
- mac环境下使用brew安装kafka
1.安装kafka brew install kafka note: ·kafka使用zookeeper管理,安装过程会自动安装zookeeper ·安装目录:/usr/local/Cellar/ka ...
- Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:
使用自己的jdk
- 回文词(UVa401)
详细题目描述见:https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_prob ...
- bzoj 1861 treap
思路:搞搞平衡树. #include<bits/stdc++.h> #define LL long long #define fi first #define se second #def ...
- bzoj 1224
dfs + 剪枝, 用最大最小值剪. #include<bits/stdc++.h> #define LL long long #define fi first #define se se ...
- poj1321 棋盘问题(DFS)
题目链接 http://poj.org/problem?id=1321 题意 给定一块棋盘(棋盘可能是不规则的),有k个相同棋子,将k个棋子摆放在棋盘上,使得任意两个棋子不同行,不同列,求有多少种不同 ...
- 实现RMQ的两种常用方法
RMQ RMQ(Range Maximum/Minimum Question)是指区间最值问题,在OI中较为常见,一般可以用ST表和线段树实现. ST表是基于倍增思想的一种打表方法,在确定区间范围和所 ...
- PHP获取客户端请求头信息
获取HTTP请求头信息 Apache 如果web服务器用的是apache,可以直接用php的库函数getallheaders() Nginx 如果web服务器用的是nginx,则无法直接使用getal ...
- Bzoj1202/洛谷P2294 [HNOI2005]狡猾的商人(带权并查集/差分约束系统)
题面 Bzoj 洛谷 题解 考虑带权并查集,设\(f[i]\)表示\(i\)的父亲(\(\forall f[i]<i\)),\(sum[i]\)表示\(\sum\limits_{j=fa[i]} ...