UIView 和 CGRect 扩展 Geometry

码农软件 · 软件分类 · 其他(Others) · 2019-07-23 08:12:50

软件介绍

Geometry 是 UIView 和 CGRect 扩展,添加了属性来进行更高效的操作:

  • top

  • left

  • bottom

  • right

  • width

  • height

  • centerX

  • centerY

  • center

myView.frame = CGRectMake(10, 10, 20, 20)
myView.left = 20 // Frame is now {{20, 10}, {20, 20}}
myView.width = 100 // Frame is now {{20, 10}, {100, 20}}
myView.right = 150 // Frame is now {{50, 10}, {100, 20}}

同时也提供 StringLiteralConverters 给 CGRect 和 CGPoint,所以你可以用 Strings 来初始化 CGRect:

myView.frame = "10, 10, 20, 20"
myView.center = "50, 50"
CGRect rect = "20, 25, 100, 100"


本文地址:https://codercto.com/soft/d/10741.html

The Art of Computer Programming, Volume 2

The Art of Computer Programming, Volume 2

Knuth, Donald E. / Addison-Wesley Professional / 1997-11-04 / USD 79.99

Finally, after a wait of more than thirty-five years, the first part of Volume 4 is at last ready for publication. Check out the boxed set that brings together Volumes 1 - 4A in one elegant case, and ......一起来看看 《The Art of Computer Programming, Volume 2》 这本书的介绍吧!

JS 压缩/解压工具
JS 压缩/解压工具

在线压缩/解压 JS 代码

html转js在线工具
html转js在线工具

html转js在线工具

HSV CMYK 转换工具
HSV CMYK 转换工具

HSV CMYK互换工具