几天来,我一直在为这个问题挠头。
基本上,问题是:
我有一个方形按钮(宽度和高度相等),图像放置在此 UIButton 的 UIImageView 中。我想为这个按钮设置一个圆形边框。所以我以这种方式实现它:
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;
好吧,边框是圆形的,但是在iphone6/iphone6s中显示时,边框看起来很模糊/模糊,底部边框甚至有点被切掉了。然而,在 iphone5s/iphone6 plus 中,边框看起来更好(虽然还是有点模糊)。所以我想知道是什么导致了这个问题?
这是它在 iphone 6 中的样子(左边的边框宽度为 0.5f,右边的为 1.f):
这是它在 iphone5s 中的样子(至少我还有底部边框):
非常感谢您!