我有該代碼。它可以將編輯按鈕添加到導航欄,但後退按鈕仍然存在,但它變得不負責任。如何從導航欄中刪除後退按鈕
UIBarButtonItem *editButton = [[UIBarButtonItem alloc]
initWithTitle:@"Edit"
style:UIBarButtonItemStyleBordered
target:nil
action:nil];
[[self.navigationController.navigationBar.items objectAtIndex:1] setRightBarButtonItem:editButton];
[[self.navigationController.navigationBar.items objectAtIndex:1]setHidesBackButton:YES];
不工作... :(按鈕仍然存在和不可點擊... ... – Radislav
可以NSLog self.navigationItem.backBarButtonItem – CarlJ
id but = [[self。 navigationController.navigationBar.items objectAtIndex:1] backBarButtonItem]返回空指針... :( – Radislav