Heriberto Quintanilla
Heriberto Quintanilla

Reputation: 55

iOS UIBarButtons don't set enabled by UIActionSheet iOS 6.1

I have three UIBarButtons on a UIToolbar. these buttons are set enabled to YES or NO depending on the state of the app.

at very moment, an UIActionSheet appears and ask to restart again, if user answer Ok, then the UIBarButtons should set enabled to YES.

It happens that the UIActionSheet disappears and the UIBarButtons show themselves as not enabled, but actually if you press them, works fine. Of course it confuses the user because the UIBarButtons appears like they are not enabled.

I'm working on Xcode 5.1, the app was built to run on iOS 7 and iOS 6.1. It works perfectly running on iOS 7, but on iOS 6.1, happens what I described above.

is it a kind of refresh problem with the UIBarButtons? is how to iOS 6.1 handle UIActionSheet different than iOS 7?

I appreciate your directives. thanks in advance.

Heriberto Q.

Upvotes: 2

Views: 52

Answers (1)

Rafał Sroka
Rafał Sroka

Reputation: 40030

That's a bug in iOS 6. How I get it to work was by hiding and showing the toolbar without animation to force the refresh:

[self.navigationController setToolbarHidden:YES animated:NO];                    
[self.navigationController setToolbarHidden:NO animated:NO];

This forces the toolbar to redraw.

Upvotes: 1

Related Questions