/* 调整行间距 */ + (void)adjustLineSpacingOfLabel:(UILabel *)label to:(CGFloat)lineSpacing { NSString *textStr = label.text; if (textStr.length <= 0) { ret ...
分类:
其他好文 时间:
2017-08-06 10:46:00
阅读次数:
98
//第一个控制器:显示基础控件 import UIKit class ViewController: UIViewController { var label: UILabel = UILabel() var button: UIButton = UIButton() var imageView: ...
分类:
编程语言 时间:
2017-08-05 10:58:58
阅读次数:
207
@interface ViewController () { dispatch_source_t _timer; } @property (weak, nonatomic) IBOutlet UILabel *timeLab; @end @implementation ViewController ... ...
分类:
其他好文 时间:
2017-08-04 15:21:58
阅读次数:
108
NSObject类的performSelectorOnMainThread和performSelectorInBackground能够实现简单的多线程编程技术 1、- (void)performSelectorInBackground:(SEL)aSelector withObject:(id)ar ...
分类:
编程语言 时间:
2017-08-01 19:09:47
阅读次数:
147
分页控制器子标题颜色渐变,重写UILable的drawRect,对UILable进行颜色填充。 #import "HMLabel.h" @implementation HMLabel //重绘UILabel - (void)drawRect:(CGRect)rect { [super drawRec ...
分类:
其他好文 时间:
2017-08-01 12:35:15
阅读次数:
230
代码如下 其中text为需要显示的字符串,font为字体大小的设置,width为显示区域的宽度 如下: 备份:http://www.jianshu.com/p/cb97662304a1 ...
分类:
编程语言 时间:
2017-07-27 20:13:15
阅读次数:
213
http://www.jianshu.com/p/83e72f90d7c1 思路:因为cell高度不固定,需要动态赋值,所以用了最常见的cell内有一个model,model内有cellHeight的方式,在cell的model的set方法中给model的cellHeght赋值。 cell.m (重 ...
分类:
其他好文 时间:
2017-07-25 18:07:24
阅读次数:
158
在打造一个类似于微信朋友圈评论输入框的时候,需要动态调整输入框的高度, 但是,在调整了UITextView的高度之后,继续输入会导致内容(UITextContainerView里的文字)抖动。 scrollRangeToVisible 方法解决了我的问题(Swift 3): 获取UITextView ...
分类:
移动开发 时间:
2017-07-23 19:54:24
阅读次数:
2154
这任务需求我们使用推特的前端框架bootstrap来实现。先放psd图。 上传这些图片也蛮大的。为此我使用office picture manager压缩了图片。 方法:alt+p+o,然后tab+下方按钮选中用于网页,点击保存就ok 一。还原含有“50万年薪”的psd静态页面 先思考: 发现1.三 ...
分类:
Web程序 时间:
2017-07-16 00:03:47
阅读次数:
202