简体   繁体   English

在基于视图的应用程序中从UIView导航到另一个UIVew?

[英]Navigate from on UIView to another UIVew in view based application?

I created a View based application in which i want to navigate from one view to another on a button click but i cannot find the right method?? 我创建了一个基于视图的应用程序,在该应用程序中,我想通过单击按钮从一个视图导航到另一个视图,但是我找不到正确的方法? is it only possible in navigation based application?? 仅在基于导航的应用程序中可行吗? i tried addsubview method but still not working?? 我尝试了addsubview方法,但仍然无法正常工作??

what is the right method to accomplish this?? 什么是实现此目的的正确方法?

- (void) applicationDidFinishLaunching: (UIApplication*) application {
    [_window addSubview: [_firstView view]];
    [_window makeKeyAndVisible];
}

// This method is on AppDelegate   
- (void) navigateToSecondView {
    [[_firstView view] removeFromSuperview];
    [_window addSubview: [_secondView view]];
}

But, you must implement an animation because this raw changes doesn't have a default one. 但是,您必须实现一种动画,因为这种原始更改没有默认设置。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM