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 设置圆角 边框颜色 点击回调方法的更多相关文章

  1. iOS开发--UIButton 设置圆角 边框颜色 点击回调方法

    UIButton *signBtn = [UIButton buttonWithType:UIButtonTypeCustom]; signBtn.frame = CGRectMake(, , , ) ...

  2. UIButton设置圆角和边框及边框颜色

    1. 按钮边框颜色 //设置边框颜色 [btn.layer setMasksToBounds:YES]; [btn.layer setCornerRadius:10.0]; //设置矩形四个圆角半径 ...

  3. Border-radius属性--设置圆角边框

    border-radius:该属性允许您为元素添加圆角边框! div { border:2px solid; border-radius:25px; -moz-border-radius:25px; ...

  4. swift设置textfield边框颜色

    //swift3.0,如果是2.0的话也可以照着这个样子去写,语法有所变动.根据联想出来的就可以了. let tx = UITextField(frame: CGRect(x: 100, y: 100 ...

  5. iOS UITextView 设置圆角边框线

    textView.layer.borderColor = UIColor.lightGray.cgColor textView.layer.cornerRadius = 4 textView.laye ...

  6. 通过CSS给图像设置圆角边框

    <html> <style> .smaller-image{ border-radius: 50%; width: 100px; } </style> <bo ...

  7. iOS之用xib给控件设置圆角、边框效果

    xib中为各种控件设置圆角 通过代码的方式设置 @interface ViewController () @property (weak, nonatomic) IBOutlet UIView *my ...

  8. 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 ...

  9. iOS UIView设置圆角

    UIView设置圆角 1.比较简单的情况,UIView四个角都是圆角: UIView *aView = [[UIView alloc] init]; aView.frame = CGRectMake( ...

随机推荐

  1. hexdump related.

    hexdump format strings Tue 13 December 2005 In tips. Ian Wienand More from the "things you'd le ...

  2. ***PHP5.6.x SSL3_GET_SERVER_CERTIFICATE:certificate verify failed 解决方案

    centos: 在php.ini中增加一行 1 openssl.cafile=/etc/pki/tls/certs/ca-bundle.crt 重启服务器使修改生效

  3. IEEEXtreme 10.0 - Mancala'h

    这是 meelo 原创的 IEEEXtreme极限编程大赛题解 Xtreme 10.0 - Mancala'h 题目来源 第10届IEEE极限编程大赛 https://www.hackerrank.c ...

  4. 一道关于数据库(经典父子级 ID 关联)更新题,大家帮忙想想还有其它解决思路没有?

    昨天,一同事发过来的一道数据库题目,就是哪种经典的父子级 ID 在同一数据库表中设计类型.需要在原表中添加一个字段,同时,将该节点的父子级详细信息插入到原表新增的一字段中,具体效果如下图. AreaC ...

  5. 解决 .net HttpClient 调用时出现的 "A task was cancelled" 错误

    近日在系统中集成ElasticClient客户端,自动创建索引.删除索引,发现通过 ElasticClient 的 LowerLevelClient 无法正确返回结果,但是索引已成功创建或删除. 并会 ...

  6. 【LOJ】#2007. 「SCOI2015」国旗计划

    题解 考虑朴素的做法,断环为链,复制2M个,找到一个位置i,f(i)是这个位置之前开始的线段,结束位置最远的位置在哪 然后对于每一个人,从自己线段的起点往下跳,跳到起点+M或以后的步数就是答案 我们发 ...

  7. [转]跟我一起写Makefile系列

    原作者:陈皓专栏 [空谷幽兰,心如皓月] 跟我一起写 Makefile(一) 跟我一起写 Makefile(二) 跟我一起写 Makefile(三) 跟我一起写 Makefile(四) 跟我一起写 M ...

  8. lr11_Vugen_Genrial Options选项介绍:

    lr11_Vugen_Genrial Options选项介绍:

  9. loadrunner场景中按scenario和group执行的区别

    group:多个脚本之间按照独立设置模式跑,各个脚本可以单独设置虚拟用户.运行时间等 scenario:多个脚本之间按照相同的模式跑,将总的虚拟用户数按照一定的比例分配给各个脚本

  10. TestDirector自定义管理:工程配置

    一.工程配置 1.进入工程配置界面 2.点击“customize project entities”弹出自定义字段对话框.(这里有六个表,每个表中的字段分为系统字段(system fields)和用户 ...