• 关于ios 8 7 下的模态窗口大小的控制 代碼+場景(mainstoryboard)( Resizing UIModalPresentationFormSheet )


    1 代碼

    UIViewController* modalController = [[UIViewController alloc]init];
    modalController.modalTransitionStyle = UIModalTransitionStyleCrossDissolve;
    modalController.modalPresentationStyle = UIModalPresentationFormSheet;

    //Resizing size
    CGPoint frameSize = CGPointMake([[UIScreen mainScreen] bounds].size.width*0.95f, [[UIScreen mainScreen] bounds].size.height*0.95f);
    CGRect screenRect = [[UIScreen mainScreen] bounds];
    CGFloat screenWidth = screenRect.size.width;
    CGFloat screenHeight = screenRect.size.height;
    if ([[[UIDevice currentDevice]systemVersion] floatValue] >= 8.0 )
    {
    // Resizing for iOS 8
    modalController.preferredContentSize = CGSizeMake(frameSize.x, frameSize.y);
    }
    else
    {
    // Resizing for <= iOS 7
    modalController.view.superview.frame = CGRectMake((screenWidth - frameSize.x)/2, (screenHeight - frameSize.y)/2, frameSize.x, frameSize.y);
    }
    UIViewController *vc = [[[[UIApplication sharedApplication] delegate] window] rootViewController];
    [vc presentViewController:modalController animated:YES completion:nil];

    2 場景

     打開態窗體屬性導航器Show Utilities=》找到show the attributes inspector=》修改Presentation +Content size大小(選中user preferred explicit size

     文件瀏覽器快捷鍵 cmd+0    工具欄(utilities)cmd+alt+0

  • 相关阅读:
    杜教筛
    GCD Counting Codeforces
    洛谷 P4317 花神的数论题 || bzoj3209
    About set HDU
    Queue Sequence HDU
    bzoj2154||洛谷P1829 Crash的数字表格&&JZPTAB && bzoj3309 DZY Loves Math
    洛谷 P1445 [Violet]樱花
    洛谷 P2158 [SDOI2008]仪仗队 && 洛谷 P1447 [NOI2010]能量采集
    nginx中使用waf防火墙
    wordpress安装
  • 原文地址:https://www.cnblogs.com/Rampage/p/4061972.html
Copyright © 2020-2023  润新知