• UINavagationController页面跳转


    1.在AppDelegate中设置第一个加载的页面,根VIEW

    - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {

        FirstViewController *firstController = [[FirstViewController alloc] init];

        self.window.rootViewController = [[UINavigationController alloc]initWithRootViewController:firstController];

        self.window.backgroundColor = [UIColor whiteColor];

        [self.window makeKeyAndVisible];

        return YES;

    }

    2.页面跳转

        SecondViewController *secondController = [[SecondViewController alloc]init];

        [self.navigationController pushViewController:secondController animated:YES];

    3.页面返回

    -(void)backToFirstClick

    {

        UINavigationController *topNavagation  = self.navigationController.topViewController;

        if([topNavagation isKindOfClass:[SecondViewController class]])

        {

            UIAlertView *alertView = [[UIAlertView alloc]initWithTitle:@"" message:@"确定要返回第一个页面吗?" delegate:self cancelButtonTitle:@"取消" otherButtonTitles:@"确定", nil];

            [alertView show];

        }

    }

    - (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex

    {

        if(buttonIndex == 1)

        {

            [self.navigationController popViewControllerAnimated:YES];

        }

    }

  • 相关阅读:
    X-CTF(REVERSE入门) python-trade
    X-CTF(REVERSE入门) getit
    X-CTF(REVERSE入门) csaw2013reversing2
    X-CTF(REVERSE入门) no-strings-attached
    X-CTF(REVERSE入门) insanity
    X-CTF(REVERSE入门) logmein
    面向对象编程的七大设计原则
    二叉树的性质
    Visual Studio 2017 WPF应用(.Net Freamwork)断点调试不命中的解决方法
    C语言读写文件
  • 原文地址:https://www.cnblogs.com/xiangjune/p/4955338.html
Copyright © 2020-2023  润新知