代码之家  ›  专栏  ›  技术社区  ›  sudo rm -rf

如何用XIB插入子视图?

  •  0
  • sudo rm -rf  · 技术社区  · 15 年前

    谢谢!

    3 回复  |  直到 15 年前
        1
  •  1
  •   SushiGrass Jacob    15 年前

    将实用程序应用程序用作模板可能是最简单的。

    从那里,您可以看到如何加载视图控制器和NIB,以生成新视图,随后将如何退出视图。

        2
  •  1
  •   sudo rm -rf    15 年前

     NewViewController *new = [[NewViewController alloc] initWithNibName:@"NewViewController" bundle:nil];
    new.delegate = self;
    new.modalTransitionStyle = UIModalTransitionStyleCoverVertical;
    [self presentModalViewController:new animated:YES];
    [new release];
    
        3
  •  0
  •   Altealice    15 年前

    你用的是导航控制器,对吧?

    NewViewController *newView = ... // [alloc - init your view here if you haven't already]
    [self.navigationController pushViewController:newView animated:YES];
    

    在newView的按钮上,

    [self.navigationController popViewControllerAnimated:YES]