代碼: - (void)viewDidLoad { [super viewDidLoad]; // Do any additional setup after loading the view. self.title=@"圓角矩形"; UIImageView *imageView=[[UIImage ...
代碼:
- (void)viewDidLoad
{
[super viewDidLoad];
// Do any additional setup after loading the view.
self.title=@"圓角矩形";
UIImageView *imageView=[[UIImageView alloc]initWithFrame:CGRectMake(50, 100, 100, 100)];
imageView.backgroundColor=[UIColor redColor];
//設計其圓角半徑
[imageView.layer setCornerRadius:18.0f];
[imageView.layer setMasksToBounds:YES];
[self.view addSubview:imageView];
}