【问题标题】:Back ground color of tab bar More button view标签栏的背景颜色 更多按钮视图
【发布时间】:2012-11-07 06:32:10
【问题描述】:

我想改变这个视图的颜色。我希望标签栏更多按钮视图颜色与应用颜色相同,而不是白色。怎么可能。

【问题讨论】:

  • 您想更改 tabBar 项目颜色或更多选项卡视图控制器颜色?
  • this SO answer,我们自定义标签栏视图颜色
  • 更多选项卡 ViewController 颜色。

标签: iphone objective-c ios ios4


【解决方案1】:

为此,您必须自定义 moreNavigationController。一种解决方案是将您的UITabBarController 子类化并在- (void)viewDidLoad 方法上添加以下内容。

- (void)viewDidLoad
{
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    UINavigationController *moreController = self.moreNavigationController;
    //if u want to custamize navigationBar u can customize
    //moreController.navigationBar

    if ([moreController.topViewController.view isKindOfClass:[UITableView class]]) {
        //Custamize your tableview here
        UITableView *tableView = (UITableView *)moreController.topViewController.view;
        //Change the color of tableView
        [tableView setBackgroundColor:[UIColor redColor]];

        moreController.topViewController.view = tableView;
    }
}

希望对你有帮助

要自定义tabBarItem,您可以关注其他答案。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2016-08-20
    • 1970-01-01
    • 1970-01-01
    • 2021-06-12
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-06-19
    相关资源
    最近更新 更多