Skip to Main Content
iPhone SDK Programming: Developing Mobile Applications for Apple iPhone and iPod touch
book

iPhone SDK Programming: Developing Mobile Applications for Apple iPhone and iPod touch

by Maher Ali
March 2009
Beginner to intermediate content levelBeginner to intermediate
396 pages
8h 44m
English
Wiley
Content preview from iPhone SDK Programming: Developing Mobile Applications for Apple iPhone and iPod touch

Chapter 7. Special-Purpose Views

In this chapter, we present several important subclasses of the UIView class. In Section 7.1, we discuss picker views and show how they can be used for item selection. In Section 7.2, we discuss progress views and also talk about activity indicator views. Section 7.3 presents text views used in displaying multiline text. In Section 7.4 we show how to use alert views for the display of alert messages to the user. Similar to alert views are action sheets which are discussed in Section 7.5. In Section 7.6, we discuss several aspects of web views.

Picker View

The UIPickerView class can be used for giving the user a fancy way to select an item from a set of values. The class allows you to have multiple sets of values where each set is represented by a wheel. The user spins the wheel in order to select a specific value from a given set. The values in a given set can be views (such as instances of UILabel, UIImageView, etc.) or strings.

Each wheel is a graphical representation of a component. Components are numbered starting from 0. Each component contains rows (i.e., the set of values). Rows are also numbered starting from 0.

You can dynamically change the contents of any component. To force a change in the contents of a specific component, change the underlying data model (e.g., the array) representing the values of the component and call the UIPickerView's method reloadComponent: passing in the component index. If you would like to change all the components, ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Microsoft® Office Access 2007 on Demand

Microsoft® Office Access 2007 on Demand

Steve Johnson - Perspection, Inc.
FileMaker Pro 14: The Missing Manual

FileMaker Pro 14: The Missing Manual

Stuart Gripman, Susan Prosser
Microsoft® Office Access™ 2007 Step by Step

Microsoft® Office Access™ 2007 Step by Step

Steve Lambert Joan Lambert and M. Dow Lambert III

Publisher Resources

ISBN: 9780470742822Purchase book