Download presentation
Presentation is loading. Please wait.
Published byPearl Clark Modified over 9 years ago
1
User Interface Objects From Beginning iPhone 4 Development and The iPhone Developer’s Cookbook (Chapter 4)
2
User Interface Elements Views—visuals, provide canvas, and other interface visual objects. ViewControllers –provides a way for user to interact with your application. Can send an action (method) to a target (object) when an event (touch or tap) occurs.
3
Visual Classes Parent class –UIView Class Almost all interface objects are children of UIView class UIWindow—specialized container and home for all the views Set screen size Only see one at a time May have many views within a single window Visual Quickstart Guide iPhone SDK 3, pg 100
4
Views that Display Data UITextView Text box that may be used for display or user input Limited to single font and font size UILabel Read-only text, limited size UIImageViews Show pictures. Load with UIImage objects May load a sequence of images rather than single image
5
Views that Display Data, cont… UIWebView Display web content (HTML, PDF, etc) May use to present stylized text Support zoom and scroll MKMapViews Enables maps into application Allow map annotation (MKannotationView and MKPinAnnotionView) UIScrollView Display larger than normal content Adds horizontal and/or vertical scrolling Supports zoom
6
Views for Making Choices UIAlertView Pop-up windows May customize message and buttons Use when have two to three choices UIActionSheet Menus that scroll up from bottom of screen Serve same function as Alert view. Use when have 4 or more choices
7
Inputs and Values UIButton Displays a button Triggers an event/action Listed as Round Rect Buttons UISegmentedControl Displays a row of equally sized buttons Behave as radio buttons UISwitch On-off switch display
8
cont… UISlider Slider along a horizontal bar Set value for the bar UIPageControl Lets user move between pages UITextFields Offer single line of text input
9
Tables and Pickers UITableView Scrolling list of choices Offer rows of information UIPicker Select choices by scrolling individual wheels UIDatePicker is specialized picker for dates
10
Bars Compact views that extend from one side of screen to the other Read the Human Interface Guidelines for limits on bar use before you add a specific bar. UINavigationBar Used for navigation UITabBar and UISearchBar UIToolBar Provide a set of actions that act on current view
11
Progress and Activity UIActivityIndicatorView Spinning wheel while task is ongoing Does not state when task will end UIProgressView Offers bar that fills from left to right
12
UIView and UIViewControllers UIView has a visual representation UIViewControllers have NO visual representation Manage views Linking views to code Handle reorientation events Handle navigation issues such as switching between views
13
UIViewControllers May be very general to very specific Introduce functionality without additional programming Limit or hide direct access to core features Example—camera access Must use UIImagePickerController to snap a photo. Class pre- built GUI and will handle the taking of the photo and saving. After image is saved then pass control back to your application. No direct access to the camera or raw image data.
14
UIViewController Parent class of view controllers Handle reorientation tasks Set how views look and which subviews are displayed Handle reaction to views being displayed or dismissed Handle view changes
15
UINavigationController Allow navigate up and down hierarchies Create navigation bars Handles push new views and generate back buttons Handles navigation details and includes a history stack
16
Other Controllers UITabBarController UITableViewController AddressBookUI.framework--has several controllers that allow access to address book information UIIMagePickerController—allows access to photo album and to use the camera MFMailComposeViewcontroller—allows creation of mail message GKPeerPickerController—provides GUI for discovering and connecting with other iPhones MPMediaPickerController—media selection GUI
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.