gpt4 book ai didi

iphone - 导航栏不见了

转载 作者:行者123 更新时间:2023-11-28 17:38:47 24 4
gpt4 key购买 nike

单击按钮时按下 kalviewcontroller 时导航栏丢失。如何添加导航栏?这样它就可以弹出以查看 Controller ,在单击按钮时将其推送。

kal = [[[KalViewController alloc] init]autorelease];
kal.title = @"Calendar of game";

kal.navigationItem.rightBarButtonItem = [[[UIBarButtonItem alloc]
initWithBarButtonSystemItem:UIBarButtonSystemItemAdd target:self
action:@selector(addEvent)] autorelease];
kal.navigationItem.leftBarButtonItem = [[[UIBarButtonItem alloc] initWithTitle:@"Back"
style:UIBarButtonItemStyleBordered target:self action:@selector(backToPrevious)]
autorelease];

kal.delegate = self;
dataSource = [self init];
kal.dataSource = dataSource;
[self.navigationController pushViewController:kal animated:YES];

最佳答案

[self.navigationController setNavigationBarHidden:FALSE] 放入您的 viewDidLoad(假设您已经创建了导航 Controller )。

关于iphone - 导航栏不见了,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8969710/

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