zoukankan      html  css  js  c++  java
  • Layout Support 获取上下bar的长度

    Layout Support

    This protocol is implemented by the UIViewController properties topLayoutGuide and bottomLayoutGuide to support using Auto Layout with a view controller’s view, starting in iOS 7. You can use layout guides as layout items in the NSLayoutConstraint factory methods.
    
    Layout Support
    length
    Provides the length, in points, of the portion of a view controller’s view that is overlaid by translucent or transparent UIKit bars. (required)
    
    Declaration
    SWIFT
    var length: CGFloat { get }
    OBJECTIVE-C
    @property(nonatomic, readonly) CGFloat length
    Discussion
    In iOS 7 and later, a view controller’s view occupies the full height of the screen when there are no opaque UIKit bars (such as opaque navigation or tab bars). To keep your content within the area of a view that is not overlaid by translucent or transparent UIKit bars, employ the topLayoutGuide and bottomLayoutGuide properties in the UIViewController class and take advantage of Auto Layout. Query these properties within your implementation of the UIViewController method viewDidLayoutSubviews.
    
    The guides work as follows:
    
    The top layout guide indicates the distance, in points, between the top of a view controller’s view and the bottom of the bottommost bar that overlays the view
    
    The bottom layout guide indicates the distance, in points, between the bottom of a view controller’s view and the top the bar (such as a tab bar) that overlays the view.
    
      If you are not using Auto Layout, you can make use of the length property and perform layout calculations yourself. Refer to the code snippets in the descriptions for the topLayoutGuide and bottomLayoutGuide properties, which explain how to obtain the numbers you need.
    
    Import Statement
    import UIKit
    
    Availability
    Available in iOS 7.0 and later.
    
    Copyright © 2014 Apple Inc. All rights reserved. Terms of Use | Privacy Policy | Updated: 2013-09-18
    
    Feedback
    
    *
    
    ** Required information

    https://developer.apple.com/library/ios/documentation/UIKit/Reference/UILayoutSupport_Protocol/index.html
  • 相关阅读:
    磁盘上没有足够的空间完成此操作的解决办法_Windows小知识
    使用XAMPP和DVWA在Windows7上搭建渗透测试环境
    使用WampServer和DVWA在Windows10上搭建渗透测试环境
    DOS系统常用命令
    Kali Linux图形界面与命令行界面的切换
    SQLMap入门之在Windows上安装SQLMap
    在Windows下同时安装Python2.x和Python3.x
    Python基础之Windows下Python3.x环境搭建
    在Linux上使用PGP签名验证文件完整性
    Ubuntu软件中心的完全启用
  • 原文地址:https://www.cnblogs.com/scaptain/p/3994432.html
Copyright © 2011-2022 走看看