ios - 为什么我的 UIBarButtonItem 按钮在某些设备上获得背景颜色?

标签 ios uibarbuttonitem uiappearance

在某些设备上,我的 UIBarButtonItem 按钮有背景色。我不知道是什么原因造成的。以下是它在某些设备上的外观:

enter image description here

在大多数设备和所有设备类型的模拟器中,它应该并且确实看起来像这样:

enter image description here

我确实对外观做了很多更改,但我看不出这些设置中的任何一个会如何导致此问题。这是我的外观设置:

func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {

    UIApplication.sharedApplication().statusBarStyle = .LightContent
    UINavigationBar.appearance().barStyle = .Black

    UINavigationBar.appearance().barTintColor = UIColor.darkGrayColor()
    UINavigationBar.appearance().tintColor = UIColor.whiteColor()
    UINavigationBar.appearance().titleTextAttributes = [NSForegroundColorAttributeName: UIColor.whiteColor()]

    UIToolbar.appearance().barTintColor = UIColor.darkGrayColor()
    UIToolbar.appearance().tintColor = UIColor.whiteColor()

    UITableView.appearance().backgroundColor = UIColor.blueColor()
    UITableView.appearance().tableFooterView = UIView(frame: CGRectZero)
    UITableViewHeaderFooterView.appearance().tintColor = UIColor.blueColor()

    return true
}

最佳答案

在具有按钮背景的设备上,在“设置”应用程序的“常规”>“辅助功能”下查看。有一个按钮形状开关。如果该开关打开,则这就是这些设备上出现此行为的原因。

如果是这个原因,那么您真的无能为力,也没有什么想做的。如果他们想让界面看起来像这样,这取决于用户。这是一个内置选项。别担心,要开心。

关于ios - 为什么我的 UIBarButtonItem 按钮在某些设备上获得背景颜色?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27630403/

相关文章:

iphone - 是否可以在不损失质量的情况下调整 UIImage 的大小?

iOS:具有外部参数的对象类中的 setter

iphone - iOS开发者有没有 'themes'?

ios - UIButton 标题在动画完成之前不会更新

ios - 如何理解 IOS 跟踪日志

ios - UIBarButtonItem 没有出现

iPhone 设置后栏按钮项目的色调颜色

iphone - 如何在运行时更改 UINaviagationBar 中 UIBarButtonItem 的类型?

ios7 - ios 7 UIBarButtonItem UIAppearance 不设置字体

ios - UILabel 外观似乎没有做任何事情