1

我们可以改变这个视图的背景颜色吗?

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

4

1 回答 1

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您可以关注其他答案。

于 2012-11-07T09:18:00.677 回答