Created
February 7, 2014 00:46
-
-
Save edom18/8855492 to your computer and use it in GitHub Desktop.
[iOS] CALayerが便利そう ref: http://qiita.com/edo_m18/items/56267b5108a79f2e1e5d
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//レイヤーを新規作成 | |
CALayer *sublayer = [CALayer layer]; | |
sublayer.backgroundColor = [UIColor blueColor].CGColor; | |
sublayer.shadowOffset = CGSizeMake(0, 3); | |
sublayer.shadowRadius = 5.0; | |
sublayer.shadowColor = [UIColor blackColor].CGColor; | |
sublayer.shadowOpacity = 0.8; | |
sublayer.frame = CGRectMake(30, 30, 120, 150); | |
sublayer.borderColor = [UIColor blackColor].CGColor; | |
sublayer.borderWidth = 2.0; | |
sublayer.cornerRadius = 10.0; | |
[self.view.layer addSublayer:sublayer]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//上記生成の後 | |
sublayer.contents = (id)[UIImage imageNamed:@"hoge.jpg"].CGImage; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment