圆角视图在iOS 9中不起作用

Yog*_*ton 9 objective-c ios ios9

我有一个代码,它采取视图并将其四舍五入 - 将其转换为圆形:

imageView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, 8, 8)];
imageView.layer.cornerRadius = imageView.frame.size.width/2;
imageView.layer.masksToBounds = YES;
Run Code Online (Sandbox Code Playgroud)

这在iOS 7和iOS 8上运行良好 - 但在iOS 9上不起作用.我该如何解决?

Yog*_*ton 9

原来为ImageView添加背景颜色可以解决问题...