In the development of the project, if the use of the story version of the design of the architecture, then set the Tabbar small icon, there may be a small problem,
The successful setup methods are as follows:
1. Set Seleectedimage and image, in fact, is a non-selected picture, set the selected is the picture, you can also set the code, as follows:
Self.tabBarController.tabBar.selectedItem.selectedImage = [UIImage imagenamed:@ "home_selected "];
2. At this time, you will find that no matter how you do it, only the colors will not display the picture properly, because the Renderingmode property of the picture is not set:
This is an enumeration in which the property values are:
Uiimagerenderingmodeautomatic // adjusts the rendering mode automatically based on the environment in which the picture is used and the drawing context in which it is located. Uiimagerenderingmodealwaysoriginal // always draws the original state of the picture without using tint Color. Uiimagerenderingmodealwaystemplate // always draws a picture based on tint color, ignoring the color information of the picture.
Set the Renderingmode property of the selected picture and unselected picture to:
for inch self.tabBar.items) { = [item.selectedimage imagewithrenderingmode: Uiimagerenderingmodealwaysoriginal]; = [Item.image imagewithrenderingmode:uiimagerenderingmodealwaysoriginal]; // item.title }
This will show up properly!
3. Change the color of the text: Click the selected location first
Then in the change, bar tint is set the background color of this tabbar, the following tint can set the color of the desired font
iOS development-use storyboard, Tabbar small icons and text color settings