gpt4 book ai didi

iphone - 从 UITabBarController 的 moreNavigationController 更改 'edit' 按钮颜色?

转载 作者:塔克拉玛干 更新时间:2023-11-02 21:42:22 24 4
gpt4 key购买 nike

我需要从 UITabBarController 的 moreNavigationController 更改“编辑”按钮颜色吗?我该怎么做??

我尝试搜索如何执行大约 3-4 小时,但找不到任何合适的解决方案。

我写了以下行代码,但它对我不起作用。

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

请提出任何建议。

最佳答案

我通过使用 UINavigationControllerDelegate 方法找到解决方案。

#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.
}

它对我有用:)

关于iphone - 从 UITabBarController 的 moreNavigationController 更改 'edit' 按钮颜色?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17316660/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com