IOS: create a UIImage or UIImageView with rounded corners

后端 未结 12 771
执笔经年
执笔经年 2020-12-07 07:26

Is it possible create an UIImage or an UIImageView with rounded corners? Because I want take an UIImage and show it inside an UI

12条回答
  •  我在风中等你
    2020-12-07 07:53

    # import QuartzCore framework
    imageView.layer.cornerRadius=imgvwUser.frame.size.width/2;
    imageView.layer.masksToBounds = YES;
    

    The height and the width of the imageView must be same to get rounded corners.

提交回复
热议问题