How to create backBarButtomItem with custom view for a UINavigationController

前端 未结 14 1209
余生分开走
余生分开走 2020-11-29 19:39

I have a UINavigationController into which I push several views. Inside viewDidLoad for one of these views I want to set the self.navigationI

14条回答
  •  青春惊慌失措
    2020-11-29 20:10

    Even though is already answered this worked for me:

    UIBarButtonItem *backButton = [[UIBarButtonItem alloc] initWithImage:[UIImage imageNamed:@"backArrow.png"] style:UIBarButtonItemStyleBordered target:nil action:nil];
    self.navigationItem.backBarButtonItem = backButton;
    [backButton release];
    

    BTW: even in iOS4 initializing my back button with initWithCustomView: didn't work for me. ;(

提交回复
热议问题