/ 更改行间距 NSString *dLabelString = cell.Content.text; NSMutableAttributedString *attributedString = [[NSMutableAttributedString alloc] initWithString:dL ...
分类:
其他好文 时间:
2016-09-02 19:01:00
阅读次数:
134
1、UILabel宽度不变,根据字体多少,自动调整UILabel的高度,并折行显示。 代码如下: UILabel *label = [[UILabel alloc] initWithFrame:CGRectMake(0, 10, 200, 20)]; label.font = [UIFont bol ...
分类:
其他好文 时间:
2016-09-02 11:24:15
阅读次数:
207
一、效果展示 1. 启动界面只有一个按钮 2. 点击按钮,显示文本信息 二、 分析 1. 两个控件UILabel && UIButton 2. 点击按钮触动方法设置文本信息 三、 实现 1. 不加载Main.storyboard 2. APPDelegate.m 3. ViewController. ...
分类:
其他好文 时间:
2016-09-02 00:46:48
阅读次数:
206
原文链接: UILabel设置圆角无效 简书主页:http://www.jianshu.com/users/37f2920f6848 Github主页:https://github.com/MajorLMJ iOS开发者公会-技术1群 QQ群号:87440292 iOS开发者公会-技术2群 QQ群号 ...
分类:
其他好文 时间:
2016-09-01 16:01:53
阅读次数:
179
1 理解自身内容尺寸约束与抗压抗拉 自身内容尺寸约束:一般来说,要确定一个视图的精确位置,至少需要4个布局约束(以确定水平位置x、垂直位置y、宽度w和高度h)。但是,某些用来展现内容的用户控件,例如文本控件UILabel、按钮UIButton、图片视图UIImageView等,它们具有自身内容尺寸( ...
分类:
其他好文 时间:
2016-08-31 11:48:21
阅读次数:
271
你真的了解UIbutton,UILabel吗? 一:首先查看一下关于UIButton的定义 @class UIImage, UIFont, UIColor, UIImageView, UILabel; //设置UIButton的样式 typedef NS_ENUM(NSInteger, UIButt ...
分类:
其他好文 时间:
2016-08-30 09:27:20
阅读次数:
150
例如:CGFloat width1 = [UILabel getWidthWithTitle:strzhengcahngshu font:cell.zhengchangLabel.font]; cell.zhengchangshuLabel.frame = CGRectMake(46, 60, wi ...
分类:
其他好文 时间:
2016-08-27 12:41:41
阅读次数:
172
一:首先查看一下关于UIButton的定义 UIButton是继承于UIControl,并且也遵循NSCoding的协议; 知识点1:关于UIControlState的Enum值 知识点2:contentHorizontalAlignment;可以设置UIButton文字的对齐方式,contentH ...
分类:
其他好文 时间:
2016-08-24 17:07:46
阅读次数:
192