- #import <QuartzCore/QuartzCore.h>//Add system framework
- Layer. backgroundcolor = [Uicolor cyancolor]. Cgcolor; //Add a background color to the layer
- Layer. Contents = (id) [UIImage imagenamed:@ "View_bg.png"]. Cgimage; //Add a background picture to the layer
- Layer. Cornerradius = 8; //Set the border of the layer to round feet
- Layer. maskstobounds = YES; //Hide Border
- Layer. borderWidth = 5; //Add a colored border to the layer
- Layer. bordercolor = [Uicolor colorwithred:0. The green:0. The Blue:0. Alpha:1]. Cgcolor;
- Layer. Shadowoffset = Cgsizemake (0, 3); //Set the offset of the shadow
- Layer. Shadowradius = 10. 0; //Set the radius of the shadow
- Layer. Shadowcolor = [Uicolor blackcolor]. Cgcolor; //Set the shadow color to black
- Layer. shadowopacity = 0. 9; //Set the opacity of the shadow
iOS Development note--layer layer fillets, borders, shading other common actions