Simple Fullscreen

Discussion in 'iOS Development' started by Teacup, Dec 17, 2007.

  1. Teacup

    Teacup New Member

    Joined:
    Dec 17, 2007
    Messages:
    3
    Likes Received:
    0
    Trying to create a simple full screen application, initially without any text, image or buttons / bars. Just to get the basic hang of windowing.

    When I run this application however, it displays nothing. Any suggestions welcome.

    Code:
    #import "MyApplication.h"
    
    @implementation MyApplication
    
    - (void) applicationDidFinishLaunching: (id) unused
    {
        UIWindow *window;
        struct CGRect rect = [UIHardware fullScreenApplicationContentRect];
        rect.origin.x = rect.origin.y = 0.0f;
    
        window = [[UIWindow alloc] initWithContentRect: rect];
        mainDisplay = [[UIView alloc] initWithFrame: rect];
    
        [window orderFront: self];
        [window makeKey: self];
        [window _setHidden: NO];
        [window setContentView: mainDisplay];    
    
    
    }
    
    @end
  2. SkylarEC

    SkylarEC Super Moderator Emeritus Staff Member

    Joined:
    Sep 19, 2007
    Messages:
    6,642
    Likes Received:
    129
    The problem is that you aren't putting anyhting into the main window, so nothing shows up. Don't forget UIView.

    Take a look at the Bluetooth.app source I posted in this same subforum.

    EDITL Link to the Bluetooth.app source code.
    http://www.ifans.com/forums/showthread.php?t=13483
  3. nudded

    nudded New Member

    Joined:
    Oct 13, 2007
    Messages:
    238
    Likes Received:
    0
    Device:
    iPod touch
    its fullscreen not fullScreen.
    and i think you need to add UIView *mainDisplay
  4. Teacup

    Teacup New Member

    Joined:
    Dec 17, 2007
    Messages:
    3
    Likes Received:
    0
    Thanks Skylar. I thought it must be something like that, but was hopeful that I could initialise screens without the need to put anything in them. Alas that's not the case.

    Anyway, onwards and upwards and thanks for the code.

Share This Page