属性字符串
来源:互联网 发布:淘宝买的催情药管用吗 编辑:程序博客网 时间:2024/06/06 08:52
属性字符串的使用:
if(!_pwdButton) { _pwdButton = [UIButton buttonWithType:UIButtonTypeSystem]; NSMutableDictionary *dic = [[NSMutableDictionary alloc]init]; //设置下划线的颜色 dic[NSUnderlineColorAttributeName] = [UIColor orangeColor]; //设置下划线可见 dic[NSUnderlineStyleAttributeName] = @YES; //设置字体 dic[NSFontAttributeName] = [UIFont systemFontOfSize:12]; //设置字体颜色 dic[NSForegroundColorAttributeName] = [UIColor orangeColor]; NSAttributedString *title = [[NSAttributedString alloc]initWithString:@"密码登录" attributes:dic]; [_pwdButton setAttributedTitle:title forState:UIControlStateNormal]; [self.view addSubview:_pwdButton]; [_pwdButton mas_makeConstraints:^(MASConstraintMaker *make) { make.top.equalTo(100); make.centerX.equalTo(0); make.height.equalTo(50); make.width.equalTo(100); }]; // [_pwdButton setAttributedTitle:title forState:UIControlStateNormal]; // [self.view addSubview:_pwdButton]; // [_pwdButton mas_makeConstraints:^(MASConstraintMaker *make) { // make.right.equalTo(-25); // make.top.equalTo(self.codeLoginButton.mas_bottom).offset(15); // }]; } return _pwdButton;}
效果如下图:
阅读全文
0 0
- 属性字符串
- 属性字符串
- 属性字符串
- NSAttributedString 详解(属性字符串)
- label赋值属性字符串
- 内存管理属性字符串
- 富文本(属性字符串)
- 设置字符串的属性
- iOS属性字符串NSMutableAttributedString
- IOS属性字符串
- 字符串的常用属性
- 自定义属性字符串
- NSAttributedString字符串属性
- iOS NSMutableAttributedString字符串属性
- 字符串属性函数
- 字符串的属性应用
- iOS-属性字符串NSAttributedString
- 连接字符串属性
- 移动社会化分享漏洞
- Codeforces Round #419 (Div. 2)
- centos7 配置nginx服务、设置开机自动启动
- spring集成阿里消息服务配置
- java.lang.IllegalArgumentException: Expected MultipartHttpServletRequest: is a MultipartResolver con
- 属性字符串
- 数据库中实现权全表更新替换
- 防盗链 原理 方法
- MD5 + BASE64加密 对音频部分md5两次
- 外部碎片和内部碎片的区别以及管理方式
- react+redux工作流程
- 用 keychain 永久存储
- 高并发接口压测
- Java变量的初始化问题探究