您的位置:首页 > 产品设计 > UI/UE

UIView的圆角矩形效果 关键是修改layer

2013-01-14 11:42 351 查看
//导入QuartzCore库
#import "QuartzCore/CALayer.h"

@interface ViewController ()

@end

@implementation ViewController

- (void)viewDidLoad
{
[super viewDidLoad];
UIView * view = [[UIView alloc] initWithFrame:CGRectMake(50, 50, 60, 60)];
view.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"2"]];
view.layer.cornerRadius = 6;
view.layer.masksToBounds = YES;
[self.view addSubview:view];
[view release];
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: