Graphics Reference
In-Depth Information
- ( void )viewDidLoad
{
[ super viewDidLoad ];
//set the corner radius on our layers
self .layerView1. layer . cornerRadius = 20.0f ;
self .layerView2. layer . cornerRadius = 20.0f ;
//add a border to our layers
self .layerView1. layer . borderWidth = 5.0f ;
self .layerView2. layer . borderWidth = 5.0f ;
//add a shadow to layerView1
self .layerView1. layer . shadowOpacity = 0.5f ;
self .layerView1. layer . shadowOffset = CGSizeMake ( 0.0f , 5.0f );
self .layerView1. layer . shadowRadius = 5.0f ;
//add same shadow to shadowView (not layerView2)
self .shadowView. layer . shadowOpacity = 0.5f ;
self .shadowView. layer . shadowOffset = CGSizeMake ( 0.0f , 5.0f );
self .shadowView. layer . shadowRadius = 5.0f ;
//enable clipping on the second layer
self .layerView2. layer . masksToBounds = YES ;
}
@end
Search WWH ::




Custom Search