使用故事板在标签栏控制器中设置所选图像 [英] Setting Selected Image in Tab Bar Controller with Storyboard
问题描述
我正在使用Storyboarding,我有一个带有五个标签的标签栏控制器。在故事板中,我可以设置标签栏项目的图像。 Apple文档建议每个标签栏项目有两个图标 - 一个用于选定状态,一个用于未选择状态。
I am using Storyboarding and I have a tab bar controller with five tabs. In the storyboard, I am able to set the image for the tab bar item. Apple docs suggest to have two icons for each tab bar item - one for selected and one for the unselected state.
我无法弄清楚我是如何做到这一点的使用故事板。
I am not able to figure out how I can do this using storyboard.
推荐答案
您可以使用故事板设置标签栏的选定图像。我试过,它对我有用。
选择UITabbarItem并添加运行时属性'selectedImage',选择Type作为'Image'并将图像名称作为其值。
You can use storyboard to set selected image of tabbar. I tried and it worked for me. Select the UITabbarItem and add a run-time attribute 'selectedImage', select Type as 'Image' and give the name of your image as its value.
我是使用XCode 6.0,我的最低部署目标是iOS 8.0。
I am using XCode 6.0 and my minimum deployment target is iOS 8.0.
这篇关于使用故事板在标签栏控制器中设置所选图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!