开发者

setting RoundRect shape Boarder to image view

开发者 https://www.devze.com 2023-03-14 07:18 出处:网络
I am using this following code to set a boarder to UIImageView. my code is: [imageview.layer setBorderColor: [[U开发者_C百科IColor orangeColor] CGColor]];

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

my code is:

[imageview.layer setBorderColor: [[U开发者_C百科IColor 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.


Add Following Lines:

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


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

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

0

精彩评论

暂无评论...
验证码 换一张
取 消