1.给cell添加一个UIView,设置UIView的高度为1,并设置这个UIView的左、下、右约束。2.不需要给cell添加任何控件,重写cell的- (void)setFrame:(CGRect)frame方法- (void)setFrame:(CGRect)frame{ frame.s...
分类:
其他好文 时间:
2015-09-07 01:50:36
阅读次数:
147
1 - (void)drawRect:(CGRect)rect { 2 3 NSLog(@"drawRect"); 4 5 //获取图形的上下文 6 CGContextRef context = UIGraphicsGetCurrentCon...
分类:
其他好文 时间:
2015-09-06 20:15:01
阅读次数:
247
Objective-C UIColor -> UIImage -?(UIImage*)?createImageWithColor:?(UIColor*)?color
{
????CGRect?rect=CGRectMake(0.0f,?0.0f,?1.0f,?1.0f);
????UIGraphicsBeginImageContext(rect.size);...
分类:
其他好文 时间:
2015-09-06 14:45:02
阅读次数:
189
去掉状态栏尺寸 CGRect?r = [?UIScreen?mainScreen ].applicationFrame; r=0,20,320,460 屏幕尺寸 CGRect?rx = [?UIScreen?mainScreen ].bounds; r=0,0,320,480 状态栏尺寸 CGRect?rect;? rect?=...
分类:
移动开发 时间:
2015-09-02 16:04:48
阅读次数:
141
第一种加载方法- (void)drawRect:(CGRect)rect { UIBezierPath *backPath = [UIBezierPath bezierPath]; [backPath moveToPoint:CGPointMake(0, 0)]; [backPat...
分类:
其他好文 时间:
2015-09-01 21:30:22
阅读次数:
259
Swift 中添加的UIView都是有层级的。
我们先添加三个看一看
let view1=UIView(frame: CGRectMake(10, 50, 200, 200))
let view2=UIView(frame: CGRectMake(60, 100, 200, 200))
let view3=UIView(frame: CGRect...
分类:
编程语言 时间:
2015-08-30 19:38:14
阅读次数:
131
//获取上下文 CGContextRef context =UIGraphicsGetCurrentContext(); //线条加粗 CGContextSetLineWidth(context , 5);CGContextSetLineWidth(context, 5); CGRect rect ...
分类:
其他好文 时间:
2015-08-29 09:39:17
阅读次数:
142
1、UIView的常见的属性@property(nonatomic) CGRect frame;
@property(nonatomic) CGRect bounds;
@property(nonatomic) CGPoint center;
@property(nonatomic) CGAffineTransform transfor...
分类:
移动开发 时间:
2015-08-29 06:19:43
阅读次数:
210
static void addRoundedRectToPath(CGContextRef context, CGRect rect, float ovalWidth, float ovalHeight){ float fw, fh; if (ovalWi...
分类:
其他好文 时间:
2015-08-28 15:27:44
阅读次数:
124
class UILabelOverride: UILabel { override func textRectForBounds(bounds: CGRect, limitedToNumberOfLines numberOfLines: Int) -> CGRect { ...
分类:
其他好文 时间:
2015-08-27 18:24:05
阅读次数:
163