Question

I've seen a number of blogs claim that UIAlertView from firmware 3.0 onwards will show a table view if too many buttons are added to it to fit in the alert box. However, I don't seem to find this the case, either in the simulator or on the device. Before I look at using one of the mechanisms for manually adding a tableview to an alert, I want to make sure I'm not replicating something the OS already does.

Was it helpful?

Solution

No, the thing that shows a table view is UIActionSheet when it has too many items. It's really ugly.

ugly!

OTHER TIPS

I've never heard of this behavior until you asked, and I've never observed it. Reading the entire UIAlertView documentation leads me to believe that this is not the case.

It sounds like you already tried adding a bunch of buttons to the UIAlertView and weren't able to replicate the behavior, so I'd call this one busted.

Yes, if you add too many buttons into UIAlertView, it will show them as tableView.

More than that, any amount of buttons you see in UIAlertView are part of integrated UITableView. So any time you click the button in the alert, you actually call didSelectRowAtIndexPath: of UITableView.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top