我想要使用默認爲「< [IMG]」而不是「<返回」的後退按鈕。將圖像添加到導航欄後退按鈕
let barAppearace = UIBarButtonItem.appearance()
barAppearace.setBackButtonTitlePositionAdjustment(UIOffsetMake(0, -60), for:UIBarMetrics.default)
與此我已刪除文本,但如何添加圖像旁邊的「<」。
我想要使用默認爲「< [IMG]」而不是「<返回」的後退按鈕。將圖像添加到導航欄後退按鈕
let barAppearace = UIBarButtonItem.appearance()
barAppearace.setBackButtonTitlePositionAdjustment(UIOffsetMake(0, -60), for:UIBarMetrics.default)
與此我已刪除文本,但如何添加圖像旁邊的「<」。
let backButton = UIBarButtonItem(image:UIImage(named: "ic_authors_detail_back.png"), style:.Plain, target:self, action:"backButtonPressed");
backButton.tintColor = UIColor(hexString: "#ffffffff")
let leftBarButtonsArray = [backButton]
navigationItem.leftBarButtonItems = leftBarButtonsArray
這裏是添加上導航bar.Hope一個按鈕的代碼這有助於
檢查:http://stackoverflow.com/questions/24769770/swift-setting-back-button-image- in-nav-bar – Hrishikesh
但我也需要「<」符號。 – Nitesh
你可以用<符號來獲取圖像。 – Hrishikesh