ios-一句代码为UIbutton增加不同状态的配置(borderColor, titleLabelFont, backgrou...
使用一句代码为UIbutton增加不同状态的配置(borderColor, titleLabelFont, backgroundColor,subView) 最新代码请移步github: https://github.com/spWang/UIButton-State 如果在使用过程中发现问题,请联系我,wsp810@163.com,如果觉得好用please give a star, 谢谢! 用法如: //setBackgroundColor 1. [button hcb_setBackgroundColor:[UIColor redColor] forState:UIControlStateNormal animated:YES]; //setborderColor 2. button.layer.borderWidth = 10; [button hcb_setborderColor:[UIColor purpleColor] forState:UIControlStateNormal animated:YES]; //setTitleLabelFont 3. [button hcb_setTitleLabelFont:[UIFont systemFontOfSize:10] forState:UIControlStateNormal]; //配置SubView 4. [button hcb_setSubViewValue:@(NSTextAlignmentLeft) forKeyPath:@"textAlignment" forState:UIControlStateNormal withSubViewTag:10001]; //使用key-Value方案来配置 5. [button hcb_configBackgroundColors:@{@(UIControlStateNormal) : [UIColor redColor], @(UIControlStateSelected) : [UIColor blueColor]}];
- 1
- 2
- 粉丝: 435
- 资源: 1万+
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助