I have a strange problem with rounded corners on a UIView. As you can see in the screenshots, the black corner is not exactly precise, which means one can see some pixels of the underlying view (i.e. white pixels in the corner highlighted with the yellow arrow).
I have set the corner radius like this:
contentView.layer.cornerRadius = 5.0f;
contentView.layer.masksToBounds = YES;
contentView is an UIView object that contains an UIImageView as subview (displays currently the Google image). Moreover contentView is added as a subview to the main view that is displayed in the screenshots.
I have already tried out several things with no satisfiable result, including:
- Added the corner radius directly to the main view, not the content view
- Increased / decreased the value of the border size and corner radius
- Changed the background color of all mentioned views to black, white and clear (currently it is clear)
I appreciate your help. Thanks!
Screenshots: