fuzzygoat
fuzzygoat

Reputation: 26223

Simple ViewController / View, remove white bar?

I am just looking at setting up a simple viewController programatically, I have a ViewController.xib file that I have set the background color to RED in interface builder. I have also added the following to my AppDelegate.m

@implementation syntax_MapViewAppDelegate
@synthesize window;

-(BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {    
    viewController = [[MapViewController alloc] init];
    [window addSubview:[viewController view]];
    [window makeKeyAndVisible];
    return YES;
}

-(void)dealloc {
    [viewController release];
    [window release];
    [super dealloc];
}
@end

When I run the code it does what I expect apart from the white bar at the bottom of the screen, can anyone give me any pointers in how to remove this? I have a feeling I might need to position the view within the window, but I am not sure how?

alt text

cheers Gary

Upvotes: 1

Views: 207

Answers (3)

BAndonovski
BAndonovski

Reputation: 3339

Something like this might save your problem:

[[viewController view] setFrame:CGRectMake(0, 20, 320, 460)]; 

Upvotes: 1

Jim
Jim

Reputation: 4719

Please set your view frame.

viewController.view.frame = CGRectMake(0.0,20.0,320.0,460.0);

Now the view cover your full screen with Red color.

You can also set it from interface builder as well.

Upvotes: 1

user342492
user342492

Reputation: 548

Set your view to resize dynamically using the autoresizingMask or set it's frame explicitly.

Upvotes: 0

Related Questions