view邊框陰影

Dean發表於2014-11-20
//新增邊框
CALayer *layer = [someView layer];
layer.borderColor = [[UIColor whiteColor] CGColor];
layer.borderWidth = 5.0f;
//新增四個邊陰影
someView.layer.shadowColor = [UIColor blackColor].CGColor;
someView.layer.shadowOffset = CGSizeMake(0, 0);
someView.layer.shadowOpacity = 0.5;
someView.layer.shadowRadius = 10.0;
//新增兩個邊陰影
someView.layer.shadowColor = [UIColor blackColor].CGColor;
someView.layer.shadowOffset = CGSizeMake(4, 4);
someView.layer.shadowOpacity = 0.5;
someView.layer.shadowRadius = 2.0;

相關文章