第一种方式: XIB
- layer.cornerRadius Number
- layer.masksToBounds Boolean
- layer.shadowOffset Size
- layer.shadowUIColor Color
- layer.shadowOpacity Number
- layer.shadowRadius Number
第二种方式: 代码
view.layer.cornerRadius = 10; view.layer.masksToBounds = NO; view.layer.shadowOffset = CGSizeMake(0, 5); view.layer.shadowColor = [UIColor blackColor].CGColor; view.layer.shadowOpacity = 0.05;//阴影透明度,默认0 view.layer.shadowRadius = 5;//阴影半径,默认3