iOS应用视图布局库 LayoutKit

码农软件 · 软件分类 · 视图布局(View Layout) · 2019-06-22 10:27:03

软件介绍

LayoutKit 是一个高性能的iOS应用视图布局库。

LayoutKit 的主要优点:

  • 速度快:性能可以与专门写的定制的布局代码相媲美,比Auto Layout快非常多;

  • 异步:在后台线程中做布局运算,所以不会干扰与用户的交互;

  • 声明性的:用不可变的数据结构声明布局,这样更容易开发、审核、调试和维护布局代码;

  • 可缓存的:布局结果都是不可变的数据结构,所以可以在后台线程中计算并缓存,可以非常大的提升性能;

而且 LayoutKit 还很好用:

  • UIKit友好:LayoutKit生成UIView,也提供适配器来方便与UITableView和UICollectionView一起使用;

  • 国际化:可以自动为从右到左的语言调整视图;

  • Swift:可以在Swift应用中使用;

  • 成熟:单元测试覆盖率超过90%,已经用于最新版的LinkedIn iOS应用;

Hello world

let image = SizeLayout<UIImageView>(width: 50, height: 50, config: { imageView in
    imageView.image = UIImage(named: "earth.jpg")
})

let label = LabelLayout(text: "Hello World!", alignment: .center)

let stack = StackLayout(
    axis: .horizontal,
    spacing: 4,
    sublayouts: [image, label])

let insets = UIEdgeInsets(top: 4, left: 4, bottom: 4, right: 8)
let helloWorld = InsetLayout(insets: insets, layout: stack)
helloWorld.arrangement().makeViews(in: rootView)

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

Persuasive Technology

Persuasive Technology

B.J. Fogg / Morgan Kaufmann / 2002-12 / USD 39.95

Can computers change what you think and do? Can they motivate you to stop smoking, persuade you to buy insurance, or convince you to join the Army? "Yes, they can," says Dr. B.J. Fogg, directo......一起来看看 《Persuasive Technology》 这本书的介绍吧!

HTML 压缩/解压工具
HTML 压缩/解压工具

在线压缩/解压 HTML 代码

XML、JSON 在线转换
XML、JSON 在线转换

在线XML、JSON转换工具

HEX CMYK 转换工具
HEX CMYK 转换工具

HEX CMYK 互转工具