iOS更改标签栏项目颜色是否安全? [英] iOS change tabbar item color is safe?

查看:99
本文介绍了iOS更改标签栏项目颜色是否安全?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正确使用以下方法更改tabbar图标颜色,

I am properly using following method to change tabbar icon color,

[tabBarController.tabBar setSelectedImageTintColor:[UIColor redColor]];

但在使用它之前,我阅读一些关于苹果的应用程序拒绝由于这个问题的帖子。我假设如果是ios5方法现在必须被接受。是真的吗?感谢。

but before using it I read some posts about apple's app rejection due to this issue. I assume that if is an ios5 method must now be accepted. Is it true? Thanks.

推荐答案

它不会被拒绝,但您必须将部署目标设置为iOS 5, iOS 4将无法下载和安装您的应用程式。

It won't be rejected, but you'll have to set your deployment target to iOS 5 and people running iOS 4 won't be able to download and install your app.

要在iOS 5上使用这个方法,但仍允许应用程式在iOS 4上运作蓝色标签)执行此操作:

To use this method only on iOS 5, and still allow the app to work on iOS 4 (with blue tabs) do this:

if ([UITabBar instancesRespondToSelector:@selector(setSelectedImageTintColor:)])
{
    [tabBarController.tabBar setSelectedImageTintColor:[UIColor redColor]];
}

此代码可安全在iOS4上运行。

This code is safe to run on iOS4.

或者,请参阅我对此问题的回答,解释如何以适用于任何iOS版本的方式完全自定义选项卡图标颜色: 8939537> tabbar item image和selectedImage

Alternatively, see my answer to this question that explains how to fully customise the tab icon colours in a way that works on any iOS version: tabbar item image and selectedImage

这篇关于iOS更改标签栏项目颜色是否安全?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆