1.给图层添加背景图片:
myView.layer.contents = (id)[UIImageimageNamed:@"view_BG.png"].CGImage;
2.将图层的边框设置为圆脚
myWebView.layer.cornerRadius = 8;
myWebView.layer.masksToBounds = YES;
3.给图层添加一个有色边框
myWebView.layer.borderWidth = 5; myWebView.layer.borderColor = [[UIColorcolorWithRed:0.52green:0.09blue:0.07alpha:1] CGColor];