clipsToBounds causes UIImage to not display in iOS10 & XCode 8

后端 未结 10 1715
南方客
南方客 2020-12-08 10:28

I switched my project over to new beta versions of iOS 10 and XCode 8. In all three areas of my app where I use:

imageView.layer.cornerRadius = imageView.fra         


        
10条回答
  •  隐瞒了意图╮
    2020-12-08 11:00

    This problem also happened to me.

    I moved these code imageView.layer.cornerRadius = imageView.frame.size.width/2 from - (void)awakeFromNib to - (void)drawRect:(CGRect)rect and this problem went away.

    My imageView is sized by autolayout. I think that height and width are not decided when awaking from nib on iOS 10.

提交回复
热议问题