views:

28

answers:

2

Hey all,

I have a navigation view controller and I want a subview to slide on top of it when a button in the parent view is clicked. Now, the thing is when I do this:

[parentView addSubview:slideView];

[UIView beginAnimations]

//setting the frame for sliding

[UIView CommitAnimations]

the sliding view goes under the navigation bar after sliding. I would like it to slide on top of the navigation bar of the parent view. How do I achieve this?

Essentially, all I am trying to do is: replicate the iPhone Add Contact application with the only difference being; unlike me, they don't have a navigation controller on the parentView but just a navigation bar with a system add button.

Anyone!!

A: 

How about something like:

[parentView addSubview:slideView];
[parentView bringSubviewToFront:slideView];

// etc
No one in particular
doesn't work man. It still goes under the navigation bar.
Bogus Boy
[self.view addSubview:newProject]; [self.view bringSubviewToFront:newProject]; frame=CGRectMake(0,-100, 320, 460); [UIView beginAnimations:nil context:nil]; [newProject setFrame:frame]; [UIView commitAnimations];
Bogus Boy
+2  A: 

Hows about using a Modal View Controller....

        UsernamePasswordViewController *usernamePasswordView = [[UsernamePasswordViewController alloc] initWithNibName:@"UsernamePassword" bundle:[NSBundle mainBundle]];
        [self.navigationController presentModalViewController:usernamePasswordView animated:YES];
        [usernamePasswordView release];

This will slide upwards by default over anything

Lee Armstrong
What I am trying to slide up is not a view controller but just another view. Are you suggesting that I make the slideView a separate view controller?
Bogus Boy
Hey Lee, I tried achieving it without making a separate view controller for my sliding view but couldn't. Finally, I did what you and one other guy suggested. Now it works perfectly fine. Thanks a million for all the cooperation.
Bogus Boy
No trouble at all.
Lee Armstrong