zoukankan      html  css  js  c++  java
  • IOS Modal(切换另外控件器方式)

    ● 除了push之外,还有另外一种控制器的切换方式,那就是Modal

    ● 任何控制器都能通过Modal的形式展示出来

    ● Modal的默认效果:新控制器从屏幕的最底部往上钻,直到盖住之前的控制器为止

    ● 以Modal的形式展示控制器

    - (void)presentViewController:(UIViewController *)viewControllerToPresent animated: (BOOL)flag completion:(void (^)(void))completion

         ● 关闭当初Modal出来的控制器
         - (void)dismissViewControllerAnimated: (BOOL)flag completion:(void (^)(void))completion;
     
    #import "HMViewController.h"
    
    @interface HMViewController ()
    
    @end
    
    @implementation HMViewController
    
    - (void)viewDidLoad
    {
        [super viewDidLoad];
        // Do any additional setup after loading the view, typically from a nib.
    }
    
    - (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
    {
        UITableViewController *tableVc = [[UITableViewController alloc] init];
        tableVc.view.backgroundColor = [UIColor redColor];
    //    tableVc.modalPresentationStyle = UIModalPresentationFormSheet;
        
        UINavigationController *nav = [[UINavigationController alloc] initWithRootViewController:tableVc];
    //    nav.modalPresentationStyle = UIModalPresentationFormSheet;
        nav.modalTransitionStyle = UIModalTransitionStylePartialCurl;
        [self presentViewController:nav animated:YES completion:nil];
    }
    
    @end
  • 相关阅读:
    JSON 基础完结 yz
    HTML5 基础教程一 yz
    HTML5 基础教程二 yz
    ADO.NET 之 一 yz
    [ lucene高级 ] Lucene docid,UID mapping and Payload [转]
    [ mongoDB ] Wordnik的MongoDB使用经验 [转]
    [ mongoDB ] MongoDB 客户端推荐
    [ mongoDB ] mongoDB replSet 添加节点注意事项
    Trie树实现[ java ]
    [ mongoDB ] MongoDB 连接池
  • 原文地址:https://www.cnblogs.com/liuwj/p/6530315.html
Copyright © 2011-2022 走看看