Vipin
Vipin

Reputation: 4728

setting RoundRect shape Boarder to image view

I am using this following code to set a boarder to UIImageView.

my code is:

[imageview.layer setBorderColor: [[UIColor orangeColor] CGColor]];
                [imageview.layer setBorderWidth: 6.0];

It looking a rectangle shape boarder.However I need a RoundRect shape for my image view Boarder or want curves in edges of UIImageView boarder. Can any one tell me a good way to do it.

Upvotes: 1

Views: 753

Answers (2)

Luke
Luke

Reputation: 11476

You may also consider Jeff LaMarche's RoundedRectView class useful.

http://iphonedevelopment.blogspot.com/2008/11/creating-transparent-uiviews-rounded.html

Upvotes: 0

rptwsthi
rptwsthi

Reputation: 10172

Add Following Lines:

[imageSubview.layer setCornerRadius:10.0];
[imageSubview.layer setMasksToBounds:YES];

Upvotes: 2

Related Questions