gpt4 book ai didi

iphone - UINavigationController 的通用右 UIBarButton

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

如何将通用右/左 UIBarButtonItem 添加到 UINavigationController?我正在尝试为所有 UIViewController 制作一个具有相同左右导航栏按钮的基于导航的应用程序谢谢你

最佳答案

创建一个基本的 UIViewController

@interface BaseController : UIViewController
{

}
@end


@implementation BaseController
- (id)init
{
//set the universal barbuttonitem
self.navigationItem.rightBarButtonItem = [[[UIBarButtonItem alloc] initWithCustomView:yourView] autorelease];
}
@end

那么你所有的 viewController 都应该从 BaseController 扩展

完成

关于iphone - UINavigationController 的通用右 UIBarButton,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10513275/

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