Select category to view:

  • ADDING OBJECTS TO VIEWS

    Adding Objects To A View

    Declare The Inputs And Output in #ViewController.h

    Declare the objects you will output to (control from code) and methods for the objects providing input. Examples: (more…)

    Change View Size

    You may want to make a reduced size view for say an input box of some sort or a view that will be used at the same size for both iPhone and iPad devices. (more…)

    Create Simple Single View For An Application

    Create Simple Single View For An Application

    Create the application
    Create view file

    (more…)

    Display View Over The Top Of Other View (Modal View)

    A great way of placing a new view over the top of a TabBarController etc which uses the whole screen (except for the status bar is there is one) so it looks as though the tab bar etc has gone. (more…)

    Methods you can use with UIViewController

    The following superclass methods may be added to a #ViewController.m file

    
    //*******************************
    //*******************************
    //********** LOAD VIEW **********
    //*******************************
    //*******************************
    //View being loaded (happens only when view is initially loaded or reloaded in memory)
    - (void)loadView
    {
        [super loadView];
    }
    
     (more...)

    Modal View Controller

    To Show A View Controller Modally

    
            #ViewController_iPhone *vc1 = [[#ViewController_iPhone alloc] init];
            [self presentModalViewController:vc1 animated:YES];
            //[ptabBarController presentModalViewController:vc1 animated:YES];   //An alternative
    	[vc1 release];
    

    (more…)

    Passing Data To Another View

    An Example Using A Class

    In #ViewController.h that you want to pass data to
    
    #import 
    
     (more...)

    Programatically Controlling Views

     

    Don’t want to use UINavigationController or UITabBarController?  Then you have a problem as Apple doesn’t provide the means to control an apps views programatically very easily, for instance using code like this: (more…)

    Redraw Of The Window

    In the same way that autorelease doesn’t occur until all of the current events and functions have been completed for your application, although the window and it’s object may be marked to be re-drawn it will not occur until the application returns to the background run loop.  At this point the OS checks to see if anything need’s to be re-drawn.

    Renaming A Set Of View Files

    Rename the .h, .m and .xib files

    Update the name in the following places:

    In #ViewController.h update @interface

    (more…)

    Rotation

    See also ‘Notifications’

    Default Rotation

    In the applicaitons Info.plist add the row: (more…)

    Sideways Scrolling View

    Create Sideways Scrolling View Of Multiple Pages

    This could be for a single page ap or as one of the views within say a UITabBarController
    (more…)

    Status Bar

    Status Bar Size

    20 pixels

    Interface Builder Status Bar Setting

    The “Simulated Metrics” don’t actually alter the status bar etc, it just simulates the size and colour of the status bar so that you can layout your views without having to shift everything down by 20 pixels. (more…)

    UINavigationController For Dynamic Views Stack

    UINavigationController provides a dynamic stack of views created at run time with a navigation bar at the top.  For many applications this is used to provide all of the views the user sees. (more…)

    UITabBarController

    Applications use tab bar controllers to manage multiple distinct interfaces, each of which consists of any number of custom views and view controllers. For many applications the UITabBarController is used to provide all of the views the user sees. (more…)

    UIView

    Referencing A View In A .xib

    In #ViewController.h
    
    @interface SomeViewController : UIViewController
    {
    	UIView *MyView;
    {
    @property (nonatomic, retain) IBOutlet UIView *MyView;
    

    (more…)

    Window and Views General

    Good Resources

    Apple View Programming Guide (more…)

    Z order

    Bringing Objects To Front And Sending To Back

    Remember that UI objects such as buttons etc are all actually subviews
    (more…)