#import <QuartzCore/QuartzCore.h>
[self.content.layer setBackgroundColor:[[UIColor whiteColor] CGColor]];
[self.content.layer setBorderColor:[[UIColor grayColor] CGColor]];
[self.content.layer setBorderWidth:1.0];
[self.content.layer setCornerRadius:10.0];
[self.content.layer setMasksToBounds:YES];
self.content.clipsToBounds = YES;
self---uiimageviw
self.image=[UIImage imageWithContentsOfFile:strPath];
self.layer.masksToBounds=YES;//圆角
self.layer.cornerRadius=10.0;
self.layer.borderWidth=1.0; //边框阴影宽度
self.layer.borderColor=[[UIColor grayColor] CGColor];
本文介绍了如何使用Objective-C为UI视图设置背景颜色、边框颜色、边框宽度及圆角效果,通过简单的代码实现视图样式的美化。
853

被折叠的 条评论
为什么被折叠?



