iphone-常用的对视图图层(layer)的操作

对图层的操作:

 1.给图层添加背景图片:

 myView.layer.contents = (id)[UIImage imageNamed:@"view_BG.png"].CGImage;

 

 2.将图层的边框设置为圆脚 

myWebView.layer.cornerRadius = 8;

myWebView.layer.masksToBounds = YES;

 

3.给图层添加一个有色边框

myWebView.layer.borderWidth = 5;

myWebView.layer.borderColor = [[UIColor colorWithRed:0.52 green:0.09 blue:0.07 alpha:1CGColor];


转自:http://www.cnblogs.com/tracy-e/archive/2010/10/14/1851035.html

 posted on 2010-11-16 16:41  Sure-G  阅读(784)  评论(2编辑  收藏  举报