LoginSignup
30
30

More than 5 years have passed since last update.

ナビゲーションバーの戻るボタンのタイトルを変更する

Posted at

ナビゲーションバーの戻るボタンのタイトルを変更するには、
【戻るボタンが表示される前の画面】で設定する。

例:ViewController1 から ViewController2 に遷移する場合

ViewController1 の viewDidLoad などで

UIBarButtonItem *backButton = [[[UIBarButtonItem alloc] init] autorelease];
backButton.title = @"前の画面に戻ります";
if(iOS5以降なら)
{
// 戻るボタンの色を変えたい場合は、tintColor に UIColor をセットする
backButton.tintColor = [UIColor redColor];
}
self.navigationItem.backBarButtonItem = backButton;

30
30
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
30
30