Background:
I am working on an application with multiple tabs, so there is a more tab on the right.
Issue:
In iOS 7, the colour of icons in more tab was grey, which is Apple's default.
But from iOS 8 and later, the colour of those icons are changed to blue.
Expected:
I want the icons colour in the more tab to be grey.
I have tried multiple solutions related to UITabBar icon's images, but no one worked.
I have attached the images for both iOS7 and iOS8-and-later.
Try changing your application's global tint color. If you are using Storyboards, this option is available in the Documents section of the File Inspector.
According to Apple's documentation here, "If you don’t specify a tint for the window, it uses the system default color."
Related
I want to use TabBar in my iOS project. My Icons have their own color and each icon has different color scheme when selected. But when i add icons, it converts into iOS own colors. I cant define each icon with different color. How can i use my icons with their own color?
Go to Assets.xcassets folder in Xcode -> Select the image -> change the rendering mode to Original Image
I'm using a UISegmentedControl with images. I'm trying to use template images and tintColor, selectedSegmentTintColor and backgroundColor all have different colors so all should be visible but images are always black. Sample of this is here: http://github.com/tomspee/SegmentedControl13.
Is there any way to fix black images on UISegmentedControl?
This is what I now get on iOS 13:
This is what I had in iOS 12 and would like to get on iOS 13 as well:
To add: I've already implemented the next code to opt-out of dark mode:
<key>UIUserInterfaceStyle</key>
<string>Light</string>
go to Image Set in the assets folder and setting the images to “Original Image” under the Render As option.
See there are two reasons to show always black in iOS 13. With iOS 13 we have a black theme also. if you want to restrict the black theme. You can use the below code.
<key>UIUserInterfaceStyle</key>
<string>Light</string>
I have a blue logo on the launchscreen.storyboard on white background.
For the new DarkMode introduced with iOS 13 I like to invert the colors, i.e. blue background and white logo.
As we know this can be done using named colors from the asset catalogues, which change depending on the traits of the device.
This is working totally fine in iOS 11 and up but shows this error when trying to support iOS 10:
Named colors do not work prior to iOS 11.0.
I tried making a view controller for the launchscreen scene in code and set the colors there using the #ifavailable clause, but the compiler says a launchscreen may not have a custom class associated with it.
I also thought of using different launchscreen storyboards depending on the iOS version but I couldn't find anything about how to.
Anything I can do about it?
How to solve this problem?
Thanks,
Felix
As suggested here, the solution is to use a dynamic image for the background instead:
Create 2 images with the flat colors for light and dark mode.
Import them in your Asset Catalog and define the “Any”/“Dark” appearances.
Add a UIImageView in the background of your Launch Screen with this image (“Scale to Fill”, constrained to container).
This will compile even if your deployment target is lower than iOS 11.0, and will display the appropriate color at launch.
I've updated my iOS app to work in dark mode on iOS 13 but I am having trouble trying to get the launch screen to look good.
Currently it is a bright white screen with the app logo which looks awful in dark mode. I have tried setting the background colour of the launch screen to be a colour asset that I made with "Any Appearance" being white and "Dark Appearance" being black - but the launch screen still always shows as white.
Is there any way to get my launch screen to work properly in dark mode?
When setting up the Launch Screen storyboard, set the view "Background" color to "System Background Color". This will be white in light mode and black in dark mode. No need to use your own color asset.
I found a solution that supports earlier iOS versions as well as custom colors for each mode, dark and light, in iOS 13.
Create an image asset, set Appearances to Any, Light, Dark, and load small solid pngs with your desired colors. In this case I am using orange for light, and black for dark.
Go to your LanuchScreen.storyboard and add an image view with that image asset. Place the image behind your image logo, set Content Mode as Aspect Fill, and constrain the view to the Superview in all sides. (Make sure that your logo looks good with the two backgrounds, or set its Appearance too)
This is where I had to do a trick. For some reason, I couldn't make the back image to show up. After checking some of the comments in Launch Screen storyboard not displaying image, I added the first image in the image asset to the target bundle
The color is static in older versions of iOS, and it works well with dark and light modes in iOS 13.
I was updating my app to support new Dark Mode for iOS 13, I put "System Background Color" for the View's background in my LanuchScreen.storyboard, but surprisingly it didn't work!
The Logo image on the page was changing correctly based on Light/Dark Mode, but not the background!
I was about to apply Jose's solution, but before that, I decided to completely remove the app from my device and try again. And it worked!!
I was missing colors from my color palette in Xcode defaulty offered colors so I created my own using Color.xcassets where I created custom color set with appearences Any, Dark and set my colors.
Then I can use them in autolayout same like System Colors even in LaunchScreen
Yes Launch Screen work in dark mode, First check the background colour of your "xyz" image. if it is ok. just delete you app from device or simulator, because some time Launch Screen cached by device or simulator and you will not get the update UI on it. if you will face same problem just follow my demo app github.com/Indolia/darkmode.git
I have an iOS 6 application that sets the tint color for all navigation bar buttons to a green color by using the following:
[[UIBarButtonItem appearance] setTintColor:[UIColor colorWithRed:(100.0f/255.0f) green:(190.0f/255.0f) blue:(100.0f/255.0f) alpha:1.0f]];
This is done at the launch of the application. This works fine on phones running iOS 6 but on phones running iOS 7 the tint color is sometimes there and and sometimes not. It especially happens when an AlertView is displayed. This wipes out the tint color of any buttons displaying the correct green tint and reverts the buttons back to the standard iOS 6 blue tint.
To confirm it isn't something I'm doing in my larger project, I have created a basic template Master-detail xcode project to confirm and only added the above line and an alertview popup and this happens there as well.
I am wondering if 1.) anyone else is experiencing this 2.) if so, have you found a work-around and 3.) anyone know if Apple has confirmed this as a bug.
At this time we are not looking to convert this app to the iOS 7 look-and-feel so that is not an option. Thx.
From the official Apple Documentation:
In iOS 6, tintColor tinted the background of navigation bars, tab
bars, toolbars, search bars, and scope bars. To tint a bar background
in iOS 7, use the barTintColor property instead.
You should refer to the complete UI transition guide to see what UI elements behave in a different way in iOS 7. If you want to support both you can check the iOS version and put different code for each version:
if (floor(NSFoundationVersionNumber) <= NSFoundationVersionNumber_iOS_6_1) {
// Load resources for iOS 6.1 or earlier
} else {
// Load resources for iOS 7 or later
}