Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iPhone:navigation bar "back" button clickable = NO?

I know that we can hide navigation bar "back" button. But I dont whant to hide it ! Is there any way to make it just not clickable ?

like image 517
Jim Avatar asked Jul 21 '11 12:07

Jim


People also ask

Why does my back button not work on my iPhone?

The cause of this annoying back button bug is down to Accessibility text settings. Check your settings to see if your iPhone text is enlarged or in bold. Turn those features off as we show you below and see if it fixed the problem for you.

How do I customize the back button on my iPhone?

Check that you have the latest version of iOS on your iPhone 8 or later. Go to Settings > Accessibility > Touch, and tap Back Tap. Tap Double Tap or Triple Tap and choose an action. Double or triple tap on the back of your iPhone to trigger the action you set.

How do I make my back button invisible?

Touch “Settings” -> “Display” -> “Navigation bar” -> “Buttons” -> “Button layout”. Choose the pattern in “Hide navigation bar” -> When the app opens, the navigation bar will be automatically hidden and you can swipe up from the bottom corner of the screen to show it.


2 Answers

You can not disable the backBarButtonItem. Setting enabled property of backBarButtonItem to NO doesn't actually disables it.

It seems Apple prevented others("us") from disabling backBarButtonItem, even it ignores the target and action set to backBarButtonItem.

like image 186
EmptyStack Avatar answered Nov 09 '22 19:11

EmptyStack


try this

    self.navigationItem.leftBarButtonItem.enabled=NO;

    self.navigationItem.backBarButtonItem.enabled=NO;

Update:

It seems to be Apple doesn't allow the back button to enable / disable. Instead of that we can hide it.

    self.navigationItem.hidesBackButton = YES;
like image 37
Vijay-Apple-Dev.blogspot.com Avatar answered Nov 09 '22 21:11

Vijay-Apple-Dev.blogspot.com