iOS 给视图加边框阴影效果

self.centerView.layer.cornerRadius=5;     self.centerView.layer.shadowColor=[UIColor redColor].CGColor;//阴影的颜色     

self.centerView.layer.shadowOffset=CGSizeMake(5, 5);//阴影偏移量     

self.centerView.layer.shadowOpacity=0.8;//阴影的透明度     self.centerView.layer.shadowRadius=5;//阴影的圆角

你可能感兴趣的:(iOS 给视图加边框阴影效果)