IT tutorials
 
Mobile
 

iPhone Developer : Assembling Views and Animations - View Hierarchies

4/16/2013 9:44:01 PM
- How To Install Windows Server 2012 On VirtualBox
- How To Bypass Torrent Connection Blocking By Your ISP
- How To Install Actual Facebook App On Kindle Fire

A tree-based hierarchy orders what you see on your iPhone screen. Starting with the main window, views are laid out in a specifically hierarchical way. All views may have children, called subviews. Each view, including the window, owns an ordered list of these subviews. Views might own many subviews; they might own none. Your application determines how views are laid out and who owns whom.

Subviews display onscreen in order, always from back to front. This works something like a stack of animation cells—those transparent sheets used to create cartoons. Only the parts of the sheets that have been painted show through. The clear parts allow any visual elements behind that sheet to be seen. Views too can have clear and painted parts, and can be layered to build a complex presentation.

Figure 1 shows a little of the layering used in a typical window. Here the window owns a UINavigationController-based hierarchy. The elements layer together. The window (represented by the empty, rightmost element) owns a navigation bar, which in turn owns two subview buttons (one left and one right). The window also owns a table with its own subviews. These items stack together to build the GUI.

Figure 1. Subview hierarchies combine to build complex GUIs.

Listing 1 shows the actual view hierarchy of the window in Figure 6-1. The tree starts at the top UIWindow and shows the classes for each of the child views. If you trace your way down the tree, you can see the navigation bar (at level 2) with its two buttons (each at level 3) and the table view (level 4) with its two cells (each at level 5). Some of the items in this listing are private classes, automatically added by the SDK when laying out views. For example, the UILayoutContainerView is never used directly by developers. It’s part of the SDK’s UIWindow implementation.

The only parts missing from this listing are the dozen or so line separators for the table, omitted for space considerations. Each separator is actually a UITableViewSeparatorView instance. They belong to the UITableView and would normally display at a depth of 5.

Listing 1. To Do List View Hierarchy
[ 0] UIWindow
--[ 1] UILayoutContainerView
----[ 2] UINavigationTransitionView
------[ 3] UIViewControllerWrapperView
--------[ 4] UITableView
----------[ 5] UITableViewCell
------------[ 6] UIView
--------------[ 7] UILabel
------------[ 6] UIButton
--------------[ 7] UIImageView
------------[ 6] UIView
----------[ 5] UITableViewCell
------------[ 6] UIView
--------------[ 7] UILabel
------------[ 6] UIButton
--------------[ 7] UIImageView
------------[ 6] UIView
----------[ 5] UIImageView
----------[ 5] UIImageView
----[ 2] UINavigationBar
------[ 3] UINavigationItemView
------[ 3] UINavigationButton
--------[ 4] UIImageView
--------[ 4] UIButtonLabel
------[ 3] UINavigationButton
--------[ 4] UIImageView
--------[ 4] UIButtonLabel				  
 
Others
 
- iPhone Developer : Creating an “Online” GameKit Connection
- Java ME on Symbian OS : Handling Transitions Between Foreground and Background
- Java ME on Symbian OS : Handling JSR Fragmentation
- IPad : Using Popular and Critical Apps - Using Bento
- IPad : Using Popular and Critical Apps - Using iTap VNC
- BlackBerry Development : Pushing Data to Internal Users - Browser Push
- BlackBerry Application Data Push : How the Application Data Push Process Works
- Windows Phone 8 : Controls - Data Binding (part 4) - Control Templates
- Windows Phone 8 : Controls - Data Binding (part 3) - Data Binding Errors
- Windows Phone 8 : Controls - Data Binding (part 2) - Improving Scrolling Performance, Binding Formatting, Converters
 
25 Inspiring Game of Thrones Quotes
 
Top 10
 
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Finding containers and lists in Visio (part 2) - Wireframes,Legends
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Finding containers and lists in Visio (part 1) - Swimlanes
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Formatting and sizing lists
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Adding shapes to lists
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Sizing containers
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 3) - The Other Properties of a Control
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 2) - The Data Properties of a Control
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 1) - The Format Properties of a Control
- Microsoft Access 2010 : Form Properties and Why Should You Use Them - Working with the Properties Window
- Microsoft Visio 2013 : Using the Organization Chart Wizard with new data
programming4us programming4us
 
Popular tags
 
Video Tutorail Microsoft Access Microsoft Excel Microsoft OneNote Microsoft PowerPoint Microsoft Project Microsoft Visio Microsoft Word Active Directory Biztalk Exchange Server Microsoft LynC Server Microsoft Dynamic Sharepoint Sql Server Windows Server 2008 Windows Server 2012 Windows 7 Windows 8 Adobe Indesign Adobe Flash Professional Dreamweaver Adobe Illustrator Adobe After Effects Adobe Photoshop Adobe Fireworks Adobe Flash Catalyst Corel Painter X CorelDRAW X5 CorelDraw 10 QuarkXPress 8 windows Phone 7 windows Phone 8 BlackBerry Android Ipad Iphone iOS