简体   繁体   中英

How to set all views to a dark color and all text to white in iOS?

I'm using Xcode 6.

My app ist by default all white background and black text, text that is present in the title of the nav bar, the table views content, and the tab bar for example. I would like that all my views (the tab bar and nav bar too) to be dark gray and hence all the text previously mentioned to be white.

Should I set it up for each view of my numerous view controllers, or there is a way to set it up for all the views of the app ?

Thanks for the advice and help

在此处输入图片说明

The right way would be to set it up everywhere manually yourself. Because it will be helpful for people in the future to see what you are doing and where.

Another way, which is equally correct would be to create your own customUIViews which would by default channge their colors to grey, and customUITextField which will turn their text white and same goes for labels.

Or use Categories on top of the existing classes of UI, and create a function setUpColor/setupFontColor, and call that function everwhere you want. (I would personally go with the very first solution.)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM