开发者

addsubview gives wrong output?

i am usi开发者_如何学编程ng 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];


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 !

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜