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

Buttons

UIButton instances provide simple onscreen buttons. Users can tap them to trigger a callback via target-action programming. You specify how the button looks, what art it uses, and what text it displays.

iOS offers two ways to build buttons. You can use a precooked button, which includes several predesigned styles, or build a custom button from scratch. The current iOS SDK offers the following precooked types. As you can see, the buttons available are not general purpose. They were added to the SDK primarily for Apple’s convenience, not yours. That’s because, as a rule, Apple does not add UI features that they do not primarily consume themselves. Nonetheless, you can use these in your programs as needed if you follow Apple’s Human Interface Guidelines (HIG). Figure 9-2 shows each button.


  

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