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 . 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的长度的更多相关文章
- php中count获取多维数组长度的方法
转自:http://www.jb51.net/article/57021.htm 本文实例讲述了php中count获取多维数组长度的实现方法.分享给大家供大家参考.具体分析如下: 先来看看下面程序运行 ...
- 获取json对象的长度
获取json对象的长度跟获取一个普通对象或数组的方法不一样,json对象没有length属性,不能直接用.length直接获得. function getJsonLength(json){ var j ...
- PHP获取中英文混合字符串长度及截取
1.字符串长度 PHP获取中英文混合字符串长度的实现代码如下,1中文=1位,2英文=1位,可自行修改 /** * PHP获取字符串中英文混合长度 * @param $str string 字符串 * ...
- 获取Json对象的长度或计数
最近又开始写博客了.因为最近的工作又开始与技术方面接口了.现在在开发WEB的时候,经常会遇到JSON对象的传递,JSON是个好东西,但是它却没有提供一些简单便捷的处理方法,其中获取JSON对象的长度就 ...
- java获取MP3的播放长度
在开发一个web项目时,需要获取MP3的播放长度.上网找了一些方法,最后找到了一个可以用的java包jaudiotagger-2.2.3.jar,java包网址http://www.jthink.ne ...
- 获取Json对象的长度以及判断json对象是否为空
(如有错敬请指点,以下是我工作中遇到并且解决的问题) = = = = = = = = = = = = = = = = 获取Json对象的长度 = = = = = = = = = = = = = = ...
- javascript获取一个字符串的长度(包含中文)
/* getStrLen(str):获取一个字符串的长度(包含中文) */ function getStrLen(str){ let len = 0, i, c; for (i = 0; i < ...
- 【转】为什么使用length获取Java数组的长度
记得vamcily 曾问我:“为什么获取数组的长度用.length(成员变量的形式),而获取String的长度用.length()(成员方法的形式)?” 我当时一听,觉得问得很有道理.做同样一件事情, ...
- PHP中获取中英文混合字符串长度[主要是指个数,而不是字符串长度](转)
今晚在写框架的表单验证类时,需要判断某个字符串长度是否在指定区间内,很自然地,想到了PHP中的strlen函数. $str = 'Hello world!'; echo strlen($str); ...
随机推荐
- 开源项目:X265
1 Windows下编译X265 具体的编译环境: Windows 7(64bit) + Visual Stdio 2010 + Cmake 3.4.3 + vsyasm-1.3.0-win64 a. ...
- 【Linux】自动化部署可信任登录
Linux信任登录,免密码登录的脚本: 需要安装expect,可以yum也可以编译安装,编译后注意脚本中的expect路径. rsa.exp #!/usr/bin/expect ########### ...
- hadoop-集群管理(1)——配置文件
1. 配置文件列表如下: [tianyc@Route conf]$ pwd/home/tianyc/hadoop-1.0.4/conf[tianyc@Route conf]$ ll总用量 76-rw- ...
- RequireJS示例
建议项目结构: HTML文件结构: <!DOCTYPE html> <html> <head lang="en"> <meta chars ...
- windows服务访问网络资源(局域网内共享的文件夹)
参考: 1.http://www.cnblogs.com/jak-black/articles/windows.html 2.http://q.cnblogs.com/q/25391/ 网络映射 1. ...
- shell script 基本语法
几个符号的意义$#:代表后接的参数『个数』,以上表为例这裡显示为『 4 』:$@:代表『 "$1" "$2" "$3" "$4&q ...
- Android Virtual Devices代理上网
本机电脑是使用代理上网,然后要在avd中要连接互联网,设置步骤如下: Click on Menu Click on Settings Click on Wireless & Networks ...
- C#实现图书馆程序导入ISO-2709格式(MARC)功能
1.导入 /// <summary> /// 导入ISO2709 /// </summary> /// <param name="sender"> ...
- sqoop导入数据到hive---2
1.hive-table 从mysql导入数据到hive表中,可以使用--hive-table来指定hive的表名,不指定hive表名,则hive表名与mysql表名保持一致. sqoop impor ...
- zookeeper典型应用场景之一:master选举
对于zookeeper这种东西,仅仅知道怎么安装是远远不够的,至少要对其几个典型的应用场景进行了解,才能比较全面的知道zk究竟能干啥,怎么玩儿,以后的日子里才能知道这货如何能为我所用.于是,有了如下的 ...