在其他iOS上自定义外观兼容性 [英] Customizeappearance compatibility on others iOS

查看:96
本文介绍了在其他iOS上自定义外观兼容性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我没有看到我的问题的答案,所以我问它:
我目前正在使用(void)customizeappearance来自定义我的tabbar和navbar的设计。该功能是否会限制我的应用程序仅用于基于iOS5的iPhone?如果没有,我的酒吧会在所有设备中看到相同的吗?

I did not see an answer to my question yet so I ask it : I am currently using (void)customizeappearance to customize the design of my tabbar and navbar. Will that function restrain the use of my app to iOS5-based iPhone only ? If not, will my bars be seen the same in all devices ?

提前致谢。

这是我正在使用的方法:

Here is the method I am using :

- (void)customizeAppearance
{
    UIImage *tabBackground = [[UIImage imageNamed:@"bg_tab"]     resizableImageWithCapInsets:UIEdgeInsetsMake(0, 0, 0, 0)];
    [[UITabBar appearance] setBackgroundImage:tabBackground];
    [[UITabBar appearance] setSelectionIndicatorImage:
    [UIImage imageNamed:@"bg_tab_selected"]];
    [[UITabBar appearance] setSelectedImageTintColor:[UIColor whiteColor]];
}


推荐答案

customizeappearance不是标准方法。您实际调用哪些方法进行自定义?

customizeappearance isn't a standard method. What methods are you actually calling to do the customisation?

如果您使用的方法如setBackgroundImage:或setTintColor:您的应用很可能只能在iOS5上运行将在iOS4上崩溃。发布你正在使用的方法,我将告诉你如何安全地为iOS4做这件事。

If you are using methods like setBackgroundImage: or setTintColor: there's a good chance that your app will only run on iOS5 and will crash on iOS4. Post the methods you are using and I'll show you how to do it safely for iOS4.

这是另一个答案,解释了如何安全地调用仅限iSO5的自定义方法它们不会在iOS4上崩溃: iOS更改标签栏项目颜色安全吗?

Here's another answer that explains how to safely call iSO5-only customisation methods so that they won't crash on iOS4: iOS change tabbar item color is safe?

以下是一个如何以适用于iOS 4& 5: tabbar项目图片和selectedImage

Here's an example of how to customise in a way that works on iOS 4 & 5: tabbar item image and selectedImage

这篇关于在其他iOS上自定义外观兼容性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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