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.frame.size.width/2
imageView.clipsToBounds = true
The associated images are not displaying at all. I have attempted cleaning the project as well as the build folder, restarting the device, trying on various simulators, re-adding the imageView, programmatically setting the associated UIImage
instead of choosing one from the assets.
Removing the clipsToBounds
line shows the rectangular image regardless of whether masksToBounds
is true
or false
. How can I make a circular image in XCode8 / iOS10 ?
Edit: The project is Swift 2.x and not yet updated to Swift 3.0 syntax.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…