My application is mostly round and border.
I use the layer property of the UIView to get the angular radius and border.
But I ran into the problem that the angles are not clear.
I get the following results:
UIButton

UIImageView

You can observe a thin line border around a white or gray border.
This is my code:
button.layer.borderWidth = 2.0; button.layer.borderColor = [[UIColor whiteColor] CGColor]; button.layer.cornerRadius = 4; button.clipsToBounds = YES;
I was looking for a solution, but I did not succeed.
I tried button.layer.masksToBounds = YES , but with no effect.
Did I miss something? Or are there other methods that can give me better results compared to CALayer ?
source share