惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

J
Java Code Geeks
腾讯CDC
Jina AI
Jina AI
博客园 - 司徒正美
博客园 - 三生石上(FineUI控件)
Apple Machine Learning Research
Apple Machine Learning Research
GbyAI
GbyAI
WordPress大学
WordPress大学
Hugging Face - Blog
Hugging Face - Blog
T
The Blog of Author Tim Ferriss
小众软件
小众软件
M
MIT News - Artificial intelligence
MyScale Blog
MyScale Blog
D
Docker
H
Hackread – Cybersecurity News, Data Breaches, AI and More
Google DeepMind News
Google DeepMind News
月光博客
月光博客
L
LangChain Blog
F
Fortinet All Blogs
Microsoft Azure Blog
Microsoft Azure Blog
博客园 - Franky
C
Check Point Blog
U
Unit 42
人人都是产品经理
人人都是产品经理

博客园 - toon的泥瓦匠

在oj中Python的循环输入问题解决 LeetCode 2. Add Two Numbers swift LeetCode 01 Two Sum swift Protocol in Objective-C 阿里云Center OS 6.2 Nginx 配置 SSL/TLS HTTPS配置 阿里云Centos 6.3 64位 安全加固版 升级 Php 中的 Curl 7.19 到 7.35 iOS APNS配置(转) GCD dispath_async dispath_sync 各种混合使用测试情况 Mac OS X Redmine Backlogs安装日志 设计模式建议学习顺序 调试iOS 已经发布代码 Crash 文件分析出出错对应代码 iOS RSA公钥加密数据 服务端接受PHP私钥解密 反过服务端公钥加密数据 iOS端私钥解密数据 xcode调试找出错误行 iOS 日期格式串 setDateFormat 显示格式代码 iOS5 UI 设计新手段 Storyboard Non-SQL 完成公司核名 varchar(max) text sqlserver 2005 数据库的正则替换 sqlserver 2005 full-text 的创建和使用 - toon的泥瓦匠
UIEdgeInsets
toon的泥瓦匠 · 2011-05-04 · via 博客园 - toon的泥瓦匠


iPhone中有UIEdgeInsets描述一个边。 
[pre]typedef struct UIEdgeInsets {
    CGFloat top, left, bottom, right;  // specify amount to inset (positive) for each of the edges. values can be negative to 'outset'
} UIEdgeInsets;

[/pre]粉红色是下面的观点是w100 × H100的,顶:10,左:20,底部:30,右:40应用长方形UIEdgeInsets,一个灰色的矩形代表一个透明。 

图一 

contentInset
这个图一用UIEdgeInsetsMake()函数来创建。
[pre]UIEdgeInsets contentInset= UIEdgeInsetsMake(10.0f,20.0f,30.0f,40.0f);[/pre]灰色半透明的区域计算如下。
[pre] CGRect grayViewRect; grayViewRect = UIEdgeInsetsInsetRect(_pinkView.frame,contentInset);
_grayView.frame = grayViewRect;[/pre]UIEdgeInsets每个字段可以是负值。 在这种情况下,表示有扩大矩形。 顶部:-10,左:-20,底部:-30,右:从UIEdgeInsets -40 grayViewRect计算为如下所示。 

UIEdgeInsetsZero常量可用。 这是一个上,左,下,右UIEdgeInsets为全零的常量。
UIEdgeInsets,NSStringFromUIEdgeInsets()函数都可以使用。
[pre] NSLog(@“UIEdgeInsetsZero =%@”,NSStringFromUIEdgeInsets(UIEdgeInsetsZero)); / / UIEdgeInsetsZero = {0,0,0,0}