开发者

Moving the position of the back item in a UINavigationBar iPhone

开发者 https://www.devze.com 2022-12-10 10:13 出处:网络
Trying to move the position of the back item on the UINavigationBar by getting a handle to the backbutton however I only seem to be able to make it disappear rather than do anything with it

Trying to move the position of the back item on the UINavigationBar by getting a handle to the backbutton however I only seem to be able to make it disappear rather than do anything with it

I have the following in viewDidLoad

self.navigationItem.leftBarButtonItem.title =@"Testing";
self.navigationItem.backBarButtonItem.title= @"1234";

They do not work howev开发者_JAVA百科er

self.navigationItem.hidesBackButton = YES;

Works as you would expect, looking through the documentation it looks like higher up the backItem might be readonly is this the case?

self.navigationController.navigationBar.backItem; // readonly

Any pointers on how to move this in approx 30 pixels much appreciated!


I don't believe this is possible. However, you can define a custom button (with back functionality) and place it wherever you want on the nav bar. Then simply hide the back button

0

精彩评论

暂无评论...
验证码 换一张
取 消