iOS: UIButton border color looks fuzzy/blurred only in iphone6(s)

292 Views Asked by At

I have been scratching my hair for this question for several days.

Basically, the problem is:

I have a square button(equal width and height), with an image placed in this UIButton's UIImageView. And I want to have a circular border for this button. So I achieve it in this way:

self.myButton.imageView.layer.borderColor = [[UIColor colorWithWhite:1 alpha:0.68] CGColor];
self.myButton.imageView.layer.borderWidth = 0.5f;
self.myButton.imageView.layer.cornerRadius = self.myButton.imageView.frame.size.height / 2;

Well, the border is circular, but when it is displayed in iphone6/iphone6s, the border looks very fuzzy/blurred, and the bottom border is even a bit chopped off. However, when in iphone5s/iphone6 plus, the border looks better(though still a bit fuzzy). So I wonder what might have caused this problem?

Here is what it looks like in iphone 6 (The left one with border width 0.5f, the right one is 1.f):

enter image description here

And here is how it looks in iphone5s(at least I still have the bottom border):

enter image description here

Thank you so much in advance!

1

There are 1 best solutions below

2
Thanveer Ahammed On

Hope you checked this project in simulators only.The simulators sometimes shows this effect not at all devices.You should check this in devices.

if that screen have scrolling that issue of the bottom border is may changed.you can also check that too.the simulators making this issue not your constraints mistakes i think.

OR you can increase the border width.