Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • DownloadDownload
  • PrintPrint
Share this Page URL
Help

Chapter 13. Alerting the User > Presenting Simple Menus

Presenting Simple Menus

UIActionSheet instances create simple iOS menus. On the iPhone and iPod touch, they slide choices, basically a list of buttons representing possible actions, onto the screen and wait for the user to respond. On the iPad, they appear in popovers. Action sheets are different from alerts. Alerts stand apart from the interface and are better used for demanding attention. Menus slide into a view and better integrate with ongoing application work. Cocoa Touch supplies five ways to present menus:

  • showInView On the iPhone and iPod touch, this method slides the menu up from the bottom of the view. On the iPad, the action sheet is centered in the middle of the screen.

  • showFromToolBar: and showFromTabBar: For the iPhone and iPod touch, when you’re working with toolbars, tab bars, or any other kinds of bars that provide those horizontally grouped buttons that you see at the bottom of many applications, these methods align the menu with the top of the bar and slide it out exactly where it should be. On the iPad, the action sheet is centered in the middle of the screen.

  • showFromBarbuttonItem:animated: On the iPad, this method presents the action sheet as a popover from the specified bar button.

  • showFromRect:inView:animated: Shows the action sheet originating from the rectangle you specify in the coordinates of the view you specify.


  

You are currently reading a PREVIEW of this book.

                                                                                        

Get instant access to over
$1 million worth of books and videos.

  

Start a Free Trial