IOS 7中选项卡栏图标的状态

use*_*540 7 uitabbaritem uitabbar ios7

我正在学习构建我的第一个iPhone应用程序,并想知道是否有人会指出我正确的方向.

我基本上为我的标签栏(IOS 7)添加了自定义图标.现在我想为每个添加自定义选择状态图标.我该怎么做?

谢谢

贝壳

MrA*_*lek 19

从Xcode 6开始,您可以在Interface Builder中默认执行此操作.不需要像以前那样的任何自定义子类或类别.


Mat*_*uch 4

在 iOS7 上你应该设置selectedImage

\n\n
tabBarItem.selectedImage = selectedImage;\ntabBarItem.image = unselectedImage;\n
Run Code Online (Sandbox Code Playgroud)\n\n

请记住,这selectedImage在 iOS6 中不可用。
\n使用\xe2\x80\x93 setFinishedSelectedImage:withFinishedUnselectedImage:如果您必须支持 iOS6,请使用。

\n