iOS 自定义属性 attribute
来源:互联网 发布:mac ftp下载工具 编辑:程序博客网 时间:2024/06/05 22:57
//注册协议
NSMutableAttributedString *attributedString = [[NSMutableAttributedStringalloc] initWithString:@"我已阅读并同意《YESOUL条款》"];
[attributedString addAttribute:NSFontAttributeNamevalue:[UIFontsystemFontOfSize:14.0]range:NSMakeRange(0,7)];
[attributedString addAttribute:NSForegroundColorAttributeNamevalue:[UIColorcolorWithHexString:@"d20037"]range:NSMakeRange(7,10)];
UIButton *agree = [[UIButtonalloc]initWithFrame:CGRectMake(10, 10 100,30)];
[agree setAttributedTitle:attributedStringforState:UIControlStateNormal];
agree.titleLabel.textColor = [UIColorcolorWithHexString:@"ffffff"];
agree.backgroundColor=[UIColorclearColor];
//按钮文字左对齐,设置距左边多少像素
agree.contentHorizontalAlignment =UIControlContentHorizontalAlignmentLeft;
agree.titleEdgeInsets =UIEdgeInsetsMake(0,1, 0,0);
agree.titleLabel.textAlignment =NSTextAlignmentLeft;
agree.titleLabel.font = [UIFontsystemFontOfSize:15];
[self.viewaddSubview:agree];
//如图所示:
- iOS 自定义属性 attribute
- Android自定义属性attribute
- android 自定义属性(attribute)
- 一个自定义属性(Attribute)的Demo
- Js中的Attribute处理自定义属性兼容性
- 属性(Attribute)资源的使用:自定义组件
- Android 自定义属性(Attribute)详解
- Android 自定义属性(Attribute)详解
- DOM之属性(attribute)和自定义对象属性(property)
- c# 特性/属性(Attribute) 以及使用反射查看自定义特性
- 自定义view 读取 属性No resource identifier found for attribute
- c# 特性/属性(Attribute) 以及使用反射查看自定义特性
- 属性(Attribute)资源使用自定义组件,并指定属性资源中定义的属性
- 自定义View里面的自定义属性的时候报错:Attribute "color" has already been defined
- 常用属性(Attribute)
- attribute属性介绍
- structs中的attribute属性
- Attribute Certificate-属性证书
- Android studio自动导包
- java如何获取mongodb的连接并执行简单的操作?
- 图片压缩方法
- 二叉树的非递归实现(先,中,后)
- idea debug 启动速度超慢的可能原因
- iOS 自定义属性 attribute
- 沟通选择Cnskype for Business 还是 Lync
- 那些年我们刷过的算法题(排序)---有一个只由0,1,2三种元素构成的整数数组,请使用交换、原地排序而不是使用计数进行排序
- IOS 图片下载存缓存沙盒
- Spring AOP 实现原理
- 相遇
- Android内容提供者(二)创建自己的Provider
- C# time.ToString("yyyyMMddHH") "yyyyMMdd"TO--DateTime
- 关键子工程