【问题标题】:Why iOS 7 modify my textField's border on iPad?为什么 iOS 7 会在 iPad 上修改我的 textField 边框?
【发布时间】:2014-01-24 16:59:59
【问题描述】:

我正在我的 texfields 上设置边框。我把它们无边界地放在了

[self.localeField.layer setBackgroundColor: [[UIColor whiteColor] CGColor]];
[self.localeField.layer setBorderColor: [[NVGlobals border4MEColor] CGColor]];
[self.localeField.layer setBorderWidth: 0.5];

问题是在 iphone 和 iPad 应用程序之间,文本字段有不同的边框:

正确的 iPhone 视图:

错误的 iPad 视图:

为什么?

【问题讨论】:

    标签: ios iphone ipad uitextfield


    【解决方案1】:

    您的边框宽度为 0.5。我猜你的 iPhone 是视网膜设备,而你的 iPad 不是。使用标准(非基于视网膜)设备上的亚像素大小,视觉效果会变得毛茸茸。如果可能的话,我会避免它。

    试试:

    [self.localeField.layer setBorderWidth: 1.0/[UIScreen mainScreen].scale]];
    

    【讨论】:

    • 哇,我很惊讶。非常感谢,星期一我回去工作我会试试的!
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-04-27
    • 1970-01-01
    • 2012-12-06
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多