• testVC.modalPresentationStyle = UIModalPresentationFormSheet; 更改 VC大小


    本文转载至 http://www.cocoachina.com/bbs/simple/?t31199.html

    TestViewController *testVC = [[TestViewController alloc] initWithNibName:@"TestViewController" bundle:nil];
        testVC.modalPresentationStyle = UIModalPresentationFormSheet;
        testVC.modalTransitionStyle = UIModalTransitionStyleCrossDissolve;
        [self presentModalViewController:testVC animated:YES];
        testVC.view.superview.frame = CGRectMake(0, 0, 649, 397);//it's important to do this after presentModalViewController
        testVC.view.superview.center = self.view.center;

    注意:/it's important to do this after presentModalViewController

     TestViewController *testVC = [[TestViewController alloc] initWithNibName:@"TestViewController" bundle:nil];
        testVC.modalPresentationStyle = UIModalPresentationFormSheet;
        testVC.modalTransitionStyle = UIModalTransitionStyleCrossDissolve;
        [self presentModalViewController:testVC animated:YES];
        testVC.view.superview.frame = CGRectMake(0, 0, 649, 397);//it's important to do this after presentModalViewController
    ....... 

    K,问题解决。。。还一定要在[self presentModalViewController:testVC animated:YES];之后设置frame的大小!!

  • 相关阅读:
    第七组(69)团队展示
    结对编程作业
    同步异步和阻塞非阻塞
    TCP和UDP和IP和HTTP和socket
    http协议
    数据库基础知识
    准确的笑话
    Java实现多线程的方式
    HashMap
    HTTPS与HTTP
  • 原文地址:https://www.cnblogs.com/Camier-myNiuer/p/3818717.html
Copyright © 2020-2023  润新知