살군의 보조기억 장치

Another memory device…

iOS에서 그림 가장자리 라운딩rounding 처리

leave a comment »

iOS에서 그림의 가장자리를 동그랗게 잘라서 이쁘게 보여주는 방법이 있다.  UIImageView를 쓸 경우, 간단하게 이 부분을 구현할 수 있다.

If you are using a UIImageView to display the image you can simply do the following:

imageView.layer.cornerRadius = 5.0;
imageView.layer.masksToBounds = YES;

And to add a border:

imageView.layer.borderColor = [UIColor lightGrayColor].CGColor;
imageView.layer.borderWidth = 1.0;

I believe that you’ll have to import <QuartzCore/QuartzCore.h> and link against it for the above code to work.

 

retrieved from: http://stackoverflow.com/questions/262156/uiimage-rounded-corners

Advertisements

Written by gomiski

2011/07/29 at 3:37 pm

Posted in iOS, Lecture

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: