views:

31

answers:

1

hi , i am using following code , but subview is added below the the parentview not ON parent view(self.view)..any help please?

 -(IBAction)okbutton:(id)sender

 {

        obj = [[imgViewNextController alloc] initWithNibName:@"green" bundle:nil];

             obj.view.frame = self.view.frame;

   [UIView beginAnimations:@"curldown" context:nil];
     [UIView setAnimationDelegate:self];
   [UIView setAnimationDuration:.5];
   [UIView setAnimationTransition:UIViewAnimationTransitionCurlDown forView:self.view cache:YES];
    [self.view addSubview:obj.view];
   //[self.view insertSubview:obj.view aboveSubview:self.view];
    [UIView commitAnimations];
+1  A: 

Are you using a TableView ?

Some objects do (strange) things, so it may be related.

If possible give use more information about your self object.

By the way, you can try

[ self.view insertSubview: atIndex: ];

or

[ self.view insertSubview: aboveSubview: ];>

Good Luck !

Vinzius