18
17

More than 5 years have passed since last update.

UIView に影をつける

Last updated at Posted at 2012-04-22
#import <QuartzCore/QuartzCore.h>

self.layer.masksToBounds = NO;
self.layer.cornerRadius = 8; // if you like rounded corners
self.layer.shadowOffset = CGSizeMake(0, -10); // 上向きの影
self.layer.shadowRadius = 3;
self.layer.shadowOpacity = 0.8;

上の方法は簡単だが、アニメーション、リサイズする際などに遅い。
以下の blog 記事が詳しい。

結局影の画像を貼っちゃうのが簡単で速度も速そう。

18
17
2

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
18
17