Is there an easy way to create a modal menu of buttons on an iPhone?

A lot of applications seem to do this. For example, go to the Apple mail application and click the "reply" button on the toolbar. You will get a menu with buttons that say “Reply”, “Reply all”, “Forward” and “Cancel”, which will scroll from the bottom.

I suppose I could do this in order to create a short presentation in IB using the buttons I want, represent them in the models, and properly control the controller to handle the buttons.

This seems to be so common that there should be an easier way to do this (for example, how easy it is to add to the toolbar and navigation bar).

Is there any widget or shortcut that I am missing?

+3
source share
2 answers

This is actually just a UIActionSheet. You can easily create it.

http://ykyuen.wordpress.com/2010/04/14/iphone-uiactionsheet-example/

+6
source

Just create a view controller with the controls you want in IB, and then call [self presentModalViewController:[[[MyModalViewController alloc] init] autorelease] animated:YES]on the current controller.

0
source

Source: https://habr.com/ru/post/1759986/


All Articles