zoukankan      html  css  js  c++  java
  • iOS 安全区域适配

        CGRect rectStatus = [[UIApplication sharedApplication] statusBarFrame];
        CGFloat rectStatusHeight = rectStatus.size.height;
        NSLog(@"status width - %f", rectStatus.size.width); // 宽度
        NSLog(@"status height - %f", rectStatus.size.height);  // 高度
        [rootView mas_makeConstraints:^(MASConstraintMaker *make) {
            if (@available(iOS 11.0, *)) {
                make.left.equalTo(self.view.mas_safeAreaLayoutGuideLeft);
                make.right.equalTo(self.view.mas_safeAreaLayoutGuideRight);
                make.top.equalTo(self.view.mas_safeAreaLayoutGuideTop);
                make.bottom.equalTo(self.view.mas_safeAreaLayoutGuideBottom);
            } else {
                make.top.equalTo(@(rectStatusHeight));
                make.left.right.bottom.equalTo(0);
            }
        }];
  • 相关阅读:
    python字符串字典列表互转
    列表迭代器 ListIterator
    并发修改异常处理
    二月天 案例
    Calendar类
    Date类
    冒泡排序
    内部类
    python第三天
    Layui——checkbox使用
  • 原文地址:https://www.cnblogs.com/sunyaxue/p/10329315.html
Copyright © 2011-2022 走看看