ボタンに影をつける
button の layerに setShadow系のメソッドを呼べば良い。
- (void)addShadow:(UIButton*)button { [button.layer setShadowColor:[[UIColor blackColor] CGColor]]; [button.layer setShadowOffset:CGSizeMake(0, 3)]; [button.layer setShadowOpacity:0.925]; [button.layer setCornerRadius:3]; } // 設置 UIButton *btn = [UIButton buttonWithType:UIButtonTypeRoundedRect]; btn.frame = CGRectMake(100, 150, 50, 30); [self addShadow:btn]; [self.view addSubview:btn];