代码笔记圆角矩形
Posted 菜鸟and小白
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了代码笔记圆角矩形相关的知识,希望对你有一定的参考价值。
代码:
- (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];
}
以上是关于代码笔记圆角矩形的主要内容,如果未能解决你的问题,请参考以下文章