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 . 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 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 © Apple Inc. All rights reserved. Terms of Use | Privacy Policy | Updated: -- Feedback * ** Required information https://developer.apple.com/library/ios/documentation/UIKit/Reference/UILayoutSupport_Protocol/index.html

Layout Support 获取上下bar的长度的更多相关文章

  1. php中count获取多维数组长度的方法

    转自:http://www.jb51.net/article/57021.htm 本文实例讲述了php中count获取多维数组长度的实现方法.分享给大家供大家参考.具体分析如下: 先来看看下面程序运行 ...

  2. 获取json对象的长度

    获取json对象的长度跟获取一个普通对象或数组的方法不一样,json对象没有length属性,不能直接用.length直接获得. function getJsonLength(json){ var j ...

  3. PHP获取中英文混合字符串长度及截取

    1.字符串长度 PHP获取中英文混合字符串长度的实现代码如下,1中文=1位,2英文=1位,可自行修改 /** * PHP获取字符串中英文混合长度 * @param $str string 字符串 *  ...

  4. 获取Json对象的长度或计数

    最近又开始写博客了.因为最近的工作又开始与技术方面接口了.现在在开发WEB的时候,经常会遇到JSON对象的传递,JSON是个好东西,但是它却没有提供一些简单便捷的处理方法,其中获取JSON对象的长度就 ...

  5. java获取MP3的播放长度

    在开发一个web项目时,需要获取MP3的播放长度.上网找了一些方法,最后找到了一个可以用的java包jaudiotagger-2.2.3.jar,java包网址http://www.jthink.ne ...

  6. 获取Json对象的长度以及判断json对象是否为空

    (如有错敬请指点,以下是我工作中遇到并且解决的问题) = = = = = = = = = = = = = = = =  获取Json对象的长度  = = = = = = = = = = = = = = ...

  7. javascript获取一个字符串的长度(包含中文)

    /* getStrLen(str):获取一个字符串的长度(包含中文) */ function getStrLen(str){ let len = 0, i, c; for (i = 0; i < ...

  8. 【转】为什么使用length获取Java数组的长度

    记得vamcily 曾问我:“为什么获取数组的长度用.length(成员变量的形式),而获取String的长度用.length()(成员方法的形式)?” 我当时一听,觉得问得很有道理.做同样一件事情, ...

  9. PHP中获取中英文混合字符串长度[主要是指个数,而不是字符串长度](转)

    今晚在写框架的表单验证类时,需要判断某个字符串长度是否在指定区间内,很自然地,想到了PHP中的strlen函数. $str = 'Hello world!'; echo strlen($str);   ...

随机推荐

  1. gson转换带有objectId的问题

    /** * * @Description: objectid 转换成string 不然就会objectid对象序列化了 * @param @param obj * @param @return * @ ...

  2. Exceeded maximum number of retries. Exceeded max scheduling attempts 3 for instance

    Exceeded maximum number of retries. Exceeded max scheduling attempts 3 for instance

  3. css实现div悬浮层,始终停留在浏览器的最下方,不随页面的滚动条滚动改变位置或消失

    .bottom_xf{ background-color:#1D69A9; width:100%; height:2.8em; margin:0 auto; overflow:hidden; posi ...

  4. Mysql group by 排序问题

    类如 有一个 帖子的回复表,posts( id , tid , subject , message , dateline ) , id 为 自动增长字段, tid为该回复的主题帖子的id(外键关联), ...

  5. 较好的IOS新闻客户端应用源码

    兼容性较好的新闻客户端应用源码,这个是一款国外新闻客户端源码,并且这款应用兼容性非常好的,可以很好地兼容iPhone和iPad的使用,而且应用的功能很多,新闻列表,上啦下拉刷新效果,评论列表,在线评论 ...

  6. docker开发_在basic image的基础上创建自定义的image

    方法一:docker commit 1. 跑一个basic image,docker新建了一个容器 root@ubuntu:/home/thm/docker/test# docker run -i - ...

  7. IOS 支付功能的实现

    支付宝是第三方支付平台,简单来说就是协调客户,商户,银行三者关系的方便平台 使用支付宝进行一个完整的支付功能,大致有以下步骤: a 与支付宝进行签约,获得商户ID(partner)和账号ID(sell ...

  8. 异常信息:CLR无法从COM 上下文0x645e18 转换为COM上下文0x645f88,这种状态已持续60秒。拥有目标上下文/单元的线程很有可能执行的是非泵式等待或者在不发送 Windows 消息的

    异常原因: 1.写了一个死循环,这个可能性最大. 2.进行大数据量的运算,导致假死状况. 解决办法:Debug -> Exceptions -> Managed Debug Assista ...

  9. php 提示Warning: mysql_fetch_array() expects

    我的高度代码如下 include("conn.php"); if(!empty($_GET['id'])){         $sql="select * from ne ...

  10. 用Python的smtp模块发邮件的示例

    # -*- coding: UTF-8 -*- import smtplib from email.mime.multipart import MIMEMultipart from email.mim ...