Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/110.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何在iOS 7.1.1/iPhone 5s上更改导航栏按钮颜色_Ios_Iphone_Objective C_Uiappearance_Tintcolor - Fatal编程技术网

如何在iOS 7.1.1/iPhone 5s上更改导航栏按钮颜色

如何在iOS 7.1.1/iPhone 5s上更改导航栏按钮颜色,ios,iphone,objective-c,uiappearance,tintcolor,Ios,Iphone,Objective C,Uiappearance,Tintcolor,我想将工具栏按钮的颜色更改为白色 例如: [UINavigationBar appearance].barTintColor = [UIColor colorWithRed:251/255.0 green:108/255.0 blue:108/255.0 alpha:1.0]; [UINavigationBar appearance].tintColor = [UIColor whiteColor]; [UINavigationBar appearance].titleTextAttribut

我想将工具栏按钮的颜色更改为白色

例如:

[UINavigationBar appearance].barTintColor = [UIColor colorWithRed:251/255.0 green:108/255.0  blue:108/255.0 alpha:1.0];
[UINavigationBar appearance].tintColor = [UIColor whiteColor];
[UINavigationBar appearance].titleTextAttributes = @{NSForegroundColorAttributeName: [UIColor whiteColor]};
但是,在iOS 7.1.1上运行时,按钮显示为灰色,而不是白色。 模拟器上不会出现此问题

此外,UISegmentedControl也会出现同样的问题


如何使用白色作为色彩?

我发现这是由iPhone的设置造成的

我曾经也被这个问题吓坏了

查看您的设置,网址为:

常规->辅助功能->增加对比度->变暗颜色

一定要关掉深色

你会发现按钮又变成了纯白色

致克雷格·奥蒂斯:
这是iPhone的特点,有些人不喜欢纯白色,所以你不想强迫他们使用纯白色。它是所有应用程序的全局设置。打开/关闭它取决于用户自己。

我只是指出诀窍。

查看此链接,这可能会对您有所帮助。感谢-1因为虽然这对他的设备有效,但对他的用户来说并不是一个好的解决方案。这是iPhone的功能,因为有些人不喜欢纯白色,他们更喜欢灰色。它是所有应用程序的全局设置,您无法在应用程序中更改它。我只是指出诀窍是什么。打开或关闭它取决于用户自己。