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); ...
随机推荐
- 洛谷P1470 最长前缀 Longest Prefix
P1470 最长前缀 Longest Prefix 73通过 236提交 题目提供者该用户不存在 标签USACO 难度普及/提高- 提交 讨论 题解 最新讨论 求大神指导,为何错? 题目描述 在生 ...
- bzoj1216 [HNOI2003]操作系统
1216: [HNOI2003]操作系统 Time Limit: 10 Sec Memory Limit: 162 MBSubmit: 751 Solved: 419[Submit][Status ...
- JavaBean和内省
JavaBean和内省 JavaBean是一个遵循特定的写法的java类 1. 必须有一个无参的构造方法 2.属性私有化 3.私有你给的属性必须通过public类型的方法暴露给 ...
- 智能指针(二):shared_ptr实现原理
前面讲到auto_ptr有个很大的缺陷就是所有权的转移,就是一个对象的内存块只能被一个智能指针对象所拥有.但我们有些时候希望共用那个内存块.于是C++ 11标准中有了shared_ptr这样的智能指针 ...
- Git入门详解
查看分支:git branch 创建分支:git branch <name> 切换分支:git checkout <name> 创建+切换分支:git checkout -b ...
- Something wrong with EnCase index search in Unallocated area
hi, My EnCase version is v7 and I found a terrible issue about index search in Unallocated area. Wit ...
- TP-Link访问策略
参考资料: http://service.tp-link.com.cn/detail_article_111.html
- 使用TypeScript如何提升JavaScript编程效果?
TypeScript是个什么鬼?和JavaScript有什么关系? TypeScript是由微软开发的一种可快速入门的开源的编程语言,是JavaScript的一个超集,且向这个语言添加了可选的静态类型 ...
- SVN 管理
01. 源代码管理工具概述(PPT) ================================================================================ ...
- 打开新窗口(window.open) 用法
窗口名称:可选参数,被打开窗口的名称. 1.该名称由字母.数字和下划线字符组成. 2."_top"."_blank"."_selft"具有特 ...