【发布时间】:2011-11-23 13:30:41
【问题描述】:
在我的应用程序中,我想自定义标签栏的模式,但我的部署目标是 ios4,所以我在 appDelegate.m 的 appDidBecomeActive 中使用下面的代码来执行此操作:
CGRect frameTab = CGRectMake(0, 0, 480, 49);
UIView *viewTab = [[UIView alloc]initWithFrame:frameTab];
UIImage *tabBarBackground = [UIImage imageNamed:@"tab_bar.png"];
UIColor *tabColor = [[UIColor alloc]initWithPatternImage:tabBarBackground];
[viewTab setBackgroundColor:tabColor];
[[myTabBarController tabBar] insertSubview:viewTab atIndex:0];
当我使用 4.3 模拟器运行应用程序时,它可以正常工作,但是当我在 ios5 中模拟时,它不起作用,选项卡变回黑色.. 有什么帮助吗?
谢谢。
【问题讨论】:
标签: ios xcode uitabbarcontroller customization uitabbar