CGRect rectStatus = [[UIApplication sharedApplication] statusBarFrame]; CGFloat rectStatusHeight = rectStatus.size.height; NSLog(@"status width - %f",... ...
分类:
移动开发 时间:
2019-01-28 12:03:12
阅读次数:
445
1.UICollectionView的常用属性 // 1.设置位置和大小 init(frame: CGRect, collectionViewLayout layout: UICollectionViewLayout) // 2.设置子视图的布局方式 var collectionViewLayout ...
分类:
编程语言 时间:
2018-09-21 18:28:09
阅读次数:
224
UILabel的创建方法 在ViewController的viewDidLoad中添加下面的方法即可 override func viewDidLoad() { super.viewDidLoad() let label = UILabel(frame: CGRect(x:20, y:100, wi ...
分类:
移动开发 时间:
2018-09-09 23:34:18
阅读次数:
384
因为iPhoneX的产生,原本的导航栏再也不是44了,那么会出现什么问题呢?在隐藏导航栏的页面,原本的高度要向上调整一个导航栏+状态栏的高度。那么iPhoneX的导航栏高度不是44了,我们需要手动获取, 有导航栏的,代码如下: 1 2 3 4 5 6 //获取状态栏的rect CGRect stat ...
分类:
移动开发 时间:
2018-08-22 12:00:03
阅读次数:
978
1 import UIKit 2 3 class VC1: UIViewController { 4 5 fileprivate lazy var pickerV : UIPickerView = { 6 let v = UIPickerView(frame: CGRect(x: 100, y: 1... ...
分类:
编程语言 时间:
2018-07-20 13:57:16
阅读次数:
623
var mV:UIView! override func viewDidLoad() { super.viewDidLoad() mV = UIView(frame: CGRect(x: 100, y: 100, width: 100, height: 100 )) mV.backgroundCol ...
分类:
编程语言 时间:
2018-05-29 23:00:03
阅读次数:
1319
首先呢 这里说的是加载网络的pdf 可不是本地的哦 新建一个view 主要是用于循环渲染绘制pdf单页面内容 .h重写init方法 用于自定义 接收docRef文件和传入的page页面 - (instancetype)initWithFrame:(CGRect)frame documentRef:( ...
分类:
Web程序 时间:
2018-05-24 15:15:46
阅读次数:
291
1. 用CGContextRef 画文字 在 UIView的 - (void)drawRect:(CGRect)rect {} 方法中进行 CGContextRef context = UIGraphicsGetCurrentContext(); CGContextSetShouldAntialia... ...
分类:
其他好文 时间:
2018-05-12 17:30:22
阅读次数:
191
开发过程中,经常会遇到动态计算行高的问题, - (CGRect)boundingRectWithSize:(CGSize)size options:(NSStringDrawingOptions)options attributes:(nullable NSDictionary<NSString * ...
分类:
移动开发 时间:
2018-04-15 19:49:29
阅读次数:
306
前言 关于 "CAAnimation" 和 "CALayer" 类,核心动画扩展了NSKeyValueCoding协议。这个扩展为一些keys添加了默认值,扩大了封装协议,添加了为CGpoint、CGRect、CGSize和 "CATransform3D" 类型的支持。 ...
分类:
其他好文 时间:
2018-02-08 20:11:01
阅读次数:
284