1
我有一個leftBarButtonItem
,我打算把它隱藏在程序,但我發現後退按鈕將缺少箭頭<
UINavagationController上的後退按鈕缺少箭頭?
self.navigationItem.leftBarButtonItem.image = nil;
我有一個leftBarButtonItem
,我打算把它隱藏在程序,但我發現後退按鈕將缺少箭頭<
UINavagationController上的後退按鈕缺少箭頭?
self.navigationItem.leftBarButtonItem.image = nil;
如果您使用的不是leftBarButtonItem
,將其設置爲nil
:
self.navigationItem.leftBarButtonItem = nil;
只需設置image
到nil
不會爲UIBarButtonItem
工作仍然存在。
你不使用標準的後退按鈕嗎?或者你是否創建了一個自定義的並將其分配給'leftButtonItem'? – Rich
我有一個UIViewController自定義左欄按鈕,但在某些情況下,我想要刪除程序中的自定義左欄按鈕,因此將顯示默認的後退按鈕。它的工作原理除了箭頭沒有正確顯示。 – user3491799
如果你沒有使用'leftBarButtonItem',將其設置爲'nil','self.navigationItem.leftBarButtonItem =零;' – Rich