CGRect gradientRect=CGRectMake(- imageView3.bounds.size.width*1.5, 0, 4 * imageView3.bounds.size.width, imageView3.bounds.size.height); CAGradientLaye... ...
分类:
其他好文 时间:
2016-12-13 16:18:33
阅读次数:
261
开发过程中,经常会遇到动态计算行高的问题, - (CGRect)boundingRectWithSize:(CGSize)size options:(NSStringDrawingOptions)options attributes:(nullableNSDictionary<NSString *, ...
分类:
其他好文 时间:
2016-12-11 15:12:16
阅读次数:
223
实现瀑布流的效果我们可以通过重写 UICollectionViewLayout里面 - (void)prepareLayout; - (NSArray *)layoutAttributesForElementsInRect:(CGRect)rect; - (UICollectionViewLayou ...
分类:
其他好文 时间:
2016-12-09 16:03:46
阅读次数:
182
1,多行文本控件的创建 1 2 3 4 let textview = UITextView(frame:CGRect(x:10, y:100, width:200, height:100)) textview.layer.borderWidth = 1 //边框粗细 textview.layer.b ...
分类:
编程语言 时间:
2016-12-02 09:49:18
阅读次数:
372
1. Frame 每个视图都有一个frame属性,它是CGRect结构,它描述了视图所在的矩形在其父视图中的位置。 (屏幕坐标系默认的原点在左上角,x轴向右伸展,y轴向下伸展) 设置frame通常通过视图的指定初始化器initWithFrame 下面来看个例子,该例子初始化了3个相互叠加的矩形区域 ...
分类:
移动开发 时间:
2016-11-26 02:15:05
阅读次数:
293
#import "SLRefreshHeader.h"@implementation SLRefreshHeader- (instancetype)initWithFrame:(CGRect)frame{ if (self = [super initWithFrame:frame]) { // 自动 ...
分类:
其他好文 时间:
2016-11-12 11:19:50
阅读次数:
157
- (void)viewDidLayoutSubviews { [super viewDidLayoutSubviews]; CGRect frame = self.tabBar.frame; frame.size.height = 55; frame.origin.y = self.view.fr ...
分类:
移动开发 时间:
2016-10-31 12:44:26
阅读次数:
157
第一步: // 计算字符若显示的宽度与label一样宽时,它需要的高度 CGRect R = [string boundingRectWithSize:CGSizeMake(KScreenWidth,10000) options:(NSStringDrawingUsesLineFragmentOri ...
分类:
其他好文 时间:
2016-10-27 12:58:23
阅读次数:
177
绘图的步骤: 1.获取上下文 2.创建路径(描述路径) 3.把路径添加到上下文 4.渲染上下文 通常在- (void)drawRect:(CGRect)rect这个方法里面绘制图形 为什么要再drawRect里面绘图,只有在这个方法里面才能获取到跟View的layer相关联的图形上下文 一、直线的绘 ...
分类:
移动开发 时间:
2016-10-14 14:43:20
阅读次数:
336
下午在适配iPadUI的时候,用到了UIPopoverPresentationController,然后在转屏的时候需要调用UIPopoverPresentationControllerDelegate来返回一个适配后的view和CGRect,这里先看下在OC里的写法: 在OC里面你可以很方便的修改 ...
分类:
编程语言 时间:
2016-10-10 21:05:11
阅读次数:
263