How to hide the “back” button in UINavigationController?

前端 未结 14 2388
盖世英雄少女心
盖世英雄少女心 2020-12-04 07:09

Do you know how to hide the \'back\' button in a UINavigationController? Also, how to show it back, but I guess that\'s very similar to hiding it...

Just like the ma

14条回答
  •  天命终不由人
    2020-12-04 07:56

    sethidesbackbutton did not work for me for some reason

    I used this way ->

    self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithCustomView:[[UIView alloc]initWithFrame:CGRectMake(0, 0, 20, 30)]] ;
    

提交回复
热议问题