簡體   English   中英

在 iOS 中設置“更多”選項卡的導航欄按鈕樣式

[英]Setting navigation bar button style for “More” tab in iOS

我似乎無法更改導航欄按鈕樣式的樣式。 這就是我得到的。

在此處輸入圖像描述

我將 UINavigationController 子類化並執行了以下操作:

- (id)initWithRootViewController:(UIViewController *)rootViewController
{
    self = [super initWithRootViewController:rootViewController];

    if (self) 
    {
        UINavigationBar *navBar = [self navigationBar];
        [navBar setBarStyle:UIBarStyleBlack];
        [navBar setTintColor:[UIColor blackColor]];
    }

    return self;
}

我正在運行 iOS 4.3,當 UITabBarController 中存在超過 4 個選項卡時,操作系統會自動添加按鈕。

關於我可能做錯了什么的任何建議?

由於更多的導航 controller 是由操作系統處理的,這就是你必須做的。

[self.tabBarController.moreNavigationController.navigationBar setTintColor:[UIColor blackColor]];

如果它自己添加,我認為您需要將 self.navigationItem 或 self.navigationController 更改為您想要的,而不僅僅是您的自定義?

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM