Created
January 14, 2015 17:08
-
-
Save anzfactory/03ba354492833c20ecf0 to your computer and use it in GitHub Desktop.
UIImageViewを円形にして枠線つける
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
// もともとのUIImageViewを正方形にしてるんで、長さの半分 | |
imgView.layer.cornerRadius = imgView.frame.size.width / 2.f; | |
// はみ出たトコをclipするか | |
imgView.layer.masksToBounds = YES; | |
// 枠線色 | |
imgView.layer.borderColor = [UIColor colorWithRed:255.f/255.f green:192.f/255.f blue:203.f/255.f alpha:1.f].CGColor; | |
// 枠線太さ | |
imgView.layer.borderWidth = 5.f; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment