我在顶部栏设置上有4个按钮,使用leftBarButtonItems和rightBarButtonItems的按钮数组。当我推到另一个视图并返回时按钮消失了。按钮所在的区域未激活(无法选择)。如果我将应用程序放在后台并将其恢复到前台,则会恢复按钮。
有什么建议吗?
由于
以下是初始化按钮的代码:
- (void)viewDidLoad
{
[super viewDidLoad];
UIBarButtonItem *selectButton = [[UIBarButtonItem alloc] initWithTitle:@"Select" style:UIBarButtonItemStylePlain target:self action:@selector(selectPlayers:)];
UIBarButtonItem *manageButton = [[UIBarButtonItem alloc] initWithTitle:@"Manage" style:UIBarButtonItemStylePlain target:self action:@selector(managePlayers:)];
self.navigationItem.rightBarButtonItems =
[NSArray arrayWithObjects:manageButton, selectButton, nil];
UIBarButtonItem *TeamsButton = [[UIBarButtonItem alloc] initWithTitle:@"Teams" style:UIBarButtonItemStylePlain target:self action:@selector(CreateTeams:)];
UIBarButtonItem *TransferButton = [[UIBarButtonItem alloc] initWithTitle:@"Transfer" style:UIBarButtonItemStylePlain target:self action:@selector(Transfer:)];
self.navigationItem.leftBarButtonItems =
[NSArray arrayWithObjects:TeamsButton,TransferButton, nil];
}
我找到了解决方法。问题视图隐藏了状态栏。推送视图显示状态栏。如果我还隐藏了推动视图上的状态栏,则按钮不再消失。这看起来像是xcode或IOS中的错误。