Skip to content

Instantly share code, notes, and snippets.

@anzfactory
Created January 14, 2015 17:08
Show Gist options
  • Save anzfactory/03ba354492833c20ecf0 to your computer and use it in GitHub Desktop.
Save anzfactory/03ba354492833c20ecf0 to your computer and use it in GitHub Desktop.
UIImageViewを円形にして枠線つける
// もともとの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