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. asp.net(c#)修改时的赋值操作

    赋值操作方法(将信息显示至文本框中): public void Show_Infobase(int _peoid) { DataSet ds = new DataSet(); ds = platbll ...

  2. jQuery插件之Cookie

    一.jQuery.Cookie.js插件是一个轻量级的Cookie管理插件. 特别提醒,今日发现一个特别的错误,google浏览器提示:has no method $.cookie.火狐浏览器提示:$ ...

  3. 【ILSpy反编译】C# 写的程序反编译查看是不是也太容易了点吧,太恐怖了。。。

    最近由于要写一些界面的东西,写了几个月c#(之前一直做c/c++项目),发现c#写界面很方便,效果也不错,在这个过程中也听说c#程序可以很容易被反编译到,但一直也没时间去自己反编译去试着看看,心想就算 ...

  4. CuteFTP 9.0 上传文件时,中文文件名乱码

    解决办法如图: 1.右键--->属性 2.选项---->档案名称编  选择ascⅡ

  5. javaSE第九天

      第九天    50 1. final关键字(掌握)    50 (1)定义:    50 (2)特点:    51 (3)面试相关:    51 A:final修饰的局部变量    51 B:fi ...

  6. iOS 获取当前城市

    1.倒入头文件 #import <CoreLocation/CoreLocation.h> 2.实现定位协议CLLocationManagerDelegate 3.定义定位属性  @pro ...

  7. 2_2数据类型与C#部分语法[wp8特色开发与编程技巧]

    2_2数据类型 -5min 类型介绍 在上个视频中我们构建了我们第一个应用.这一次我们要来了解下c#的数据类型 众所周知,在我们已认知的世界里,我们把文字分为数字与字符.在程序的世界里面我们把数据分为 ...

  8. wp8.1 全球化解决办法

    最近在更新一个应用,在wp8.1里面重写整个应用,由于8.1版本的api.架构和windows8.1的接口高度相同,变化很大,在编码过程中,只能一边翻msdn资料一边摸索解决遇到的问题,其中程序标题和 ...

  9. BochsDebug

    Bochs User Manual   Chapter 8. Tips and Techniques   8.12. Using Bochs internal debugger Note, if yo ...

  10. 软件工程 speedsnail 冲刺6

    2015-5-10 完成任务:学习了黑马android教学视频13.14.15集,记分功能: 遇到问题: 问题1 android native method not found 解决1 没有解决 明日 ...