1、        创建工程,编写代码:

- (void)viewDidLoad {

    [super viewDidLoad];

    //读取一张图片

    UIImage *img = [UIImage imageNamed:@"pic"];

   //将该图片添加到图像视图

    UIImageView *imgView = [[UIImageView alloc] initWithImage:img];

//   CGRectrect = CGRectMake(60, 60, 200, 200);

    imgView.frame = CGRectMake(60, 60, 200, 200);

   //设置图像图层圆角半径大小

    imgView.layer.cornerRadius = 100;

   //设置图像视图层的遮罩盖属性,进行边界裁切

    imgView.layer.masksToBounds = YES;

    [self.view addSubview:imgView];}

 

运行效果:

UI09-UIView视图添加圆角效果

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-06-03
  • 2021-11-19
  • 2021-09-21
  • 2022-01-04
猜你喜欢
  • 2022-01-21
  • 2021-11-08
  • 2022-12-23
  • 2022-01-19
  • 2021-07-04
  • 2021-06-19
相关资源
相似解决方案