首页 > 移动平台 > 详细

iOS定制改动navigation的backbutton

时间:2017-06-08 15:47:30      阅读:312      评论:0      收藏:0      [点我收藏+]

iOS开发中。navigation的返回button是英文“back”。想改动成中文“返回”或者自己定义的文字。这么简单的事情却折腾了小半个小时。原来是被leftBarButtonItem和rightBarButtonItem的设置方法给迷惑了。
我们设置leftBarButtonItem和rightBarButtonItem的时候都是在当前页面。而backBarButtonItem却是在父页面;所以须要在调用

 [self.navigationControllerpushViewController:photoController animated:YES];

之前运行;代码例如以下:

  self.navigationItem.backBarButtonItem=[[UIBarButtonItemallocinitWithTitle:@”返回style:UIBarButtonItemStyleBorderedtarget:nilaction:nil];

    [self.navigationControllerpushViewController:photoController animated:YES];

赶快试试吧!

iOS定制改动navigation的backbutton

原文:http://www.cnblogs.com/claireyuancy/p/6963180.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!