//1.UIView视图的基本使用- (void)createUIView1{ CGRect rect1 = CGRectMake(30, 50, 200, 200); UIView * view1 = [[UIView alloc] initWithFrame:rect1]; [view1...
分类:
其他好文 时间:
2016-01-19 01:31:10
阅读次数:
168
1 -(void)drawRect:(CGRect)rect 2 { 3 [[UIColor clearColor]setFill]; 4 UIRectFill(rect); 5 NSInteger pulsingCount = 3; 6 double animat...
分类:
移动开发 时间:
2016-01-16 11:57:58
阅读次数:
220
11.自适应文本高度1 NSDictionary *attributes = @{NSFontAttributeName: [UIFont systemFontOfSize:14]};2 3 CGRect rect = [text boundingRectWithSize:CGSizeMake(Vi...
分类:
移动开发 时间:
2016-01-14 18:57:38
阅读次数:
493
// 键盘最终的frame CGRect keyboardF = [note.userInfo[UIKeyboardFrameEndUserInfoKey] CGRectValue]; // 动画时间 CGFloat duration = [note.userInf...
分类:
其他好文 时间:
2016-01-14 15:53:54
阅读次数:
149
- (void)drawRect:(CGRect)rect { CGContextRef context = UIGraphicsGetCurrentContext(); CGContextSetFillColorWithColor(context, [UIColo...
分类:
其他好文 时间:
2016-01-14 12:18:39
阅读次数:
133
+ (UIImage *)imageWithColor:(UIColor *)color size:(CGSize)size{ CGRect rect = CGRectMake(0, 0, size.width, size.height); UIGraphicsBeginImageContext.....
分类:
其他好文 时间:
2016-01-13 17:37:06
阅读次数:
109
1.定义:简单的说关联就是将两个对象关联起来2.用法:加入给一个label 关联一个一个字符串keyValue 如下 1.导入头文件#import 动态添加的头文件添加 2.代码如下 UILabel *label = [[UILabel alloc] initWithFrame:CGRect...
分类:
其他好文 时间:
2016-01-13 12:21:45
阅读次数:
205
1、NSRange:1 typedef struct _NSRange {2 3 NSUInteger location;4 5 NSUInteger length;6 7 } NSRange; NSRange本身是系统自定义的一个结构体的变量名;这个结构体用来表示...
分类:
其他好文 时间:
2016-01-11 18:04:02
阅读次数:
213
NSStringFromCGRect(aCGRect):CGRectFromString(aString):如果把视图的框架以字符串的形式放在NSUserDefaults里面,那么该方法可以将其转回CGRect[NSValue valueWithCGRect:rect][NSValue对象 CGRe...
分类:
其他好文 时间:
2016-01-11 01:22:34
阅读次数:
137
关于UIView的位置都会遇到,一般需要改变UIView的位置,需要先获取原有的frame位置,然后在frame上面修改,有的时候如果只是改变了一下垂直方向的位置,宽度和高度的一种,这种写法很麻烦。下面两种写法第二种明显更简单,如果需要实现第二种方法就需要扩展UIView。 //1 CG...
分类:
移动开发 时间:
2016-01-10 22:48:07
阅读次数:
306