【问题标题】:addsubview gives wrong output?addsubview 给出错误的输出?
【发布时间】:2010-09-20 09:17:31
【问题描述】:

我正在使用以下代码,但子视图添加在父视图下方而不是父视图(self.view)..有什么帮助吗?

 -(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];

【问题讨论】:

    标签: iphone ipad uiview addsubview


    【解决方案1】:

    您使用的是 TableView 吗?

    有些对象做了(奇怪的)事情,所以它可能是相关的。

    如果可能,请提供有关您自己对象的更多信息。

    对了,你可以试试

    [ self.view insertSubview: atIndex: ];

    [ self.view insertSubview: aboveSubview: ];>

    祝你好运!

    【讨论】:

      猜你喜欢
      • 2020-09-08
      • 2021-02-11
      • 2013-09-10
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多