Jules
Jules

Reputation: 7766

iphone, addSubview show view too high up, how do I move to down?

I'm using addSubView twice in my app and both times it adds the view too high up the view, its off the screen at the top. See below... I have load the views like this as I nothing else works, cause me problems.

I just don't understand why they are showing off the screen?

What do I need to do to fix this ?

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {    
[window addSubview:rootController.view];
[window makeKeyAndVisible]; 
lvc = [[GettingStartedViewController alloc] 
            initWithNibName:@"GettingStartedView" bundle:nil];
[window addSubview:lvc.view];       
return YES;
}

And in my GettingStartedView ...

- (IBAction) showHelp:(id)inSender {    
theController = [[HelpViewController alloc] initWithNibName:@"HelpView" 
                    bundle:nil onPage:HelpPageGettingStarted];
[self.view addSubview:theController.view];
}

alt text

Upvotes: 1

Views: 3122

Answers (2)

DarkDust
DarkDust

Reputation: 92316

Set the location:

rootController.view.frame = CGRectMake(0, 20, 320, 460);

Upvotes: 3

Alejandro
Alejandro

Reputation: 3746

Check the wantsFullScreenLayout property of your root view controller, make sure it's not set.

Upvotes: 1

Related Questions