【问题标题】:Animate New View from Tab Bar Application Template XCode从标签栏应用程序模板 XCode 动画新视图
【发布时间】:2011-04-24 05:59:17
【问题描述】:

我在 xcode 中创建了一个新的标签栏应用程序模板。当按下按钮时,我应该如何正确设置在(向上滑动)中动画的新视图?我已经看到使用 NavigationController 完成了这项工作。

我添加了一个导航栏和一个按钮,其中包含使用以下代码添加子视图的操作:

(IBAction)newPost:(id)sender
{
    // Load UIViewController from nib
    PostViewController *screen = [[PostViewController alloc] initWithNibName:@"PostViewController" bundle:nil];

    // Add to UINavigationController's stack, i.e. the view for this UITabBarController view
    [self.view addSubview:screen.view];

    // Release music, no longer needed since it is retained by the navController
    [screen release];
}

【问题讨论】:

    标签: iphone xcode views switching uitabview


    【解决方案1】:

    我不确定这是否是您所要求的,但如果您只是希望新的视图控制器以模态方式向上呈现自己,请执行此操作。

    1.) 新文件 --> 视图控制器

    2.)

    newViewcontroller *viewController = [[newViewcontroller alloc] initWithNibName:@"newViewcontroller" bundle:nil];
    [self presentModalViewController:viewController animated:YES];
    [viewController release];
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多