“back” text displayed in iOS7 UINavigationBar when view title is long

后端 未结 4 1641
萌比男神i
萌比男神i 2020-12-16 21:54

In my application,I need to show the previous viewController title to current viewController back title.

Its working perfectly in iOS6.

In iOS7,automaticall

4条回答
  •  臣服心动
    2020-12-16 22:05

    iOS 7 will automatically replace your back button title with "Back" or even remove the title altogether in order to fit the title of current navigation item. You probably shouldn't try to do anything about it except maybe try and make your titles shorter.

    if you want to make short title you can do as below

    self.title = @"SOME REALLY LONG NAVIGATION BAR TITLE";
    UILabel* label=[[UILabel alloc] initWithFrame:CGRectMake(0,0, 200, 40)];
    label.text=self.navigationItem.title;
    label.adjustsFontSizeToFitWidth=YES;
    self.navigationItem.titleView=label;
    

提交回复
热议问题