Storyboard Global Tint UITabBar Tint changed in IOS 7.1

匿名 (未验证) 提交于 2019-12-03 02:06:01

问题:

Have I overlooked something in just using the Global Tint to set the apps overall tint?

My App that worked in IOS 7.06 has suddenly changed today after IOS 7.1 Update.

Basic Storyboard, Tab based App with Global Tint (Orange) set in storyboard in IB.

Today updated to IOS 7.1 IPhone 5S and it is showing the standard blue tint

IPhone 4 IOS 7.06, same app TabBar tint is as it should be.

Had to set as below

[[UITabBar appearance] setTintColor:[UIColor orangeColor]]; 

in the TabBarControllers ViewDidLoad to correct the issue.

Could it be I have something else set incorrectly?

回答1:

This is a known bug in the 7.1 betas which was never fixed in the final release.

Like you, I have had the same problem and had to set it manually as a fix.

It is recommended that if you want to set a global tint color, to do so in -application:will/didFinishLaunchingWithOptions:. Alternatively, if you want specific colors for each view controller, to do so in prepareForSeque:.

Personally I have tried setting it in -viewWillAppear:animated: in my UINavigationController root view and it appears to work fine.

See the devforum thread here



回答2:

Swift code that works under iOS 11 (in AppDelegate's didFinishLaunching):

application.windows[0].rootViewController?.view.tintColor = UIColor.black 


标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!