Latest 1.0.1
Homepage https://github.com/ONECATYU/FlexKit
License MIT
Platforms ios 8.0, requires ARC
Dependencies Yoga
Frameworks UIKit, Foundation
Authors
  • 支持虚拟div,避免导致视图增多问题。
  • 支持scrollView contentSize。设置scrollView.applyFlexFrameToContentSize = true
  • 支持CALayer布局,UIView和CALayer混合布局。
  • 根据node树,UIView/CALayer自动添加到父视图。在布局结束后,调用view.yoga.adjustsViewHierarchy()

    使用

  • 可配合UITableView+FDTemplateLayoutCell使用,避免手动计算高度
contentView.makeFlexLayout { (make) in
    make.padding(12)
    make.addChild(self.titleLabel)
    make.addChild(self.contentLabel).marginTop(10)
    make.addChild(self.contentImgView).marginTop(10)
    make.addChild(nil, withMakeLayout: { (make) in
        make.flexDirection(.row).justifyContent(.spaceBetween).marginTop(10)
        make.addChild(self.userNameLabel)
        make.addChild(self.timeLabel)
    })
}

contentView.yoga.applyLayout(preservingOrigin: false)

//OC中通过@100/@"50%",分别设置数值或者百分比
make.width(@100).height(@"50%");

Latest podspec

{
    "name": "FlexKit",
    "version": "1.0.1",
    "summary": "1.u652fu6301u865au62dfdiv,u907fu514du5bfcu81f4u89c6u56feu589eu591au95eeu9898u30022.u652fu6301scrollView contentSizeu30023.u652fu6301CALayeru5e03u5c40uff0cUIViewu548cCALayeru6df7u5408u5e03u5c40u30024.u6839u636enodeu6811uff0cUIView/CALayeru81eau52a8u6dfbu52a0u5230u7236u89c6u56feu3002",
    "homepage": "https://github.com/ONECATYU/FlexKit",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "ONECATYU": "[email protected]"
    },
    "platforms": {
        "ios": "8.0"
    },
    "source": {
        "git": "https://github.com/ONECATYU/FlexKit.git",
        "tag": "1.0.1"
    },
    "source_files": [
        "FlexKit",
        "FlexKit/**/*.{h,m,swift}"
    ],
    "frameworks": [
        "UIKit",
        "Foundation"
    ],
    "requires_arc": true,
    "dependencies": {
        "Yoga": [
            "~> 1.14.0"
        ]
    },
    "swift_versions": "5.0",
    "swift_version": "5.0"
}

Pin It on Pinterest

Share This