簡體   English   中英

更改UITabBarController的moreNavigationController中的“編輯”按鈕顏色?

[英]Change 'edit' Button Color from moreNavigationController of UITabBarController?

我需要從UITabBarController的moreNavigationController更改“編輯”按鈕的顏色嗎? 我該怎么做 ??

我試圖搜索大約3-4小時后該怎么辦,但找不到任何合適的解決方案。

我寫下面的代碼行,但它對我也不起作用。

self.tabBarController.moreNavigationController.editButtonItem.tintColor = [UIColor blackColor];

請提出任何建議。

我通過使用UINavigationController Delegate方法找到解決方案。

#pragma mark -
#pragma mark - UINavigationController Delegate Methods

- (void)navigationController:(UINavigationController *)navigationController  willShowViewController:(UIViewController *)viewController  animated:(BOOL)animated
{
    UINavigationBar *morenavbar = navigationController.navigationBar;
    UINavigationItem *morenavitem = morenavbar.topItem;
    morenavitem.rightBarButtonItem.tintColor = [UIColor blackColor]; // Set Color as you need. 
}

它對我的工作:)

暫無
暫無

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

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