Giter VIP home page Giter VIP logo

eelay's Introduction

Eelay

CI Status Version License Platform

Example

To run the example project, clone the repo, and run pod install from the Example directory first.

Requirements

Installation

Eelay is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod "Eelay"

Author

zhuxietong, [email protected]

License

Eelay is available under the MIT license. See the LICENSE file for more info.

Demo代码分析

demo

26行 对view视图对象的子视图进行布局

28行 将back添加到view中并添加以下布局束

  • 设置back topview top距离为20
  • 设置back leftview left距离为20
  • 设置back bottomview bottom距离为-20
  • 设置back rightview right距离为-20

29行 将head添加到view中并添加以下布局束

  • 设置head width 为 100
  • 设置head height 为 100
  • 设置head topview top 距离为80
  • 设置head centerXview centerX距离为0

30行 将name添加到view中并添加以下布局束

  • 设置name width 小于等于 200
  • 设置name height 为 30
  • 设置name centerXview centerX 距离为-20
  • 设置name tophead bottom 距离为30

31行 将age添加到view中并添加以下布局束

  • 设置age leftname right 距离为10
  • 设置age centerXname centerY对齐

32行 将content添加到view中并添加以下布局束

  • 设置content height 大于等于200,该布局束的优先级为1000
  • 设置content left 相对于view left 距离为30
  • 设置content bottom 相对于view bottom 距离为-30 ,该布局束的优先级为500
  • 设置content right 相对于view right 距离为-30
  • 设置content topname bottom 距离为40

要点分析

将一个视图(label对象)的布局信息放在一个**[Any]**对象中,

1,[Any] 的第一个对象必须是将要布局的视图对象,

[label,]

2,[Any] 中添加 Double或Int或Float值 可设置宽度,

[label,200],

该值处理时转换成[String:Double]类型,类型中包含优先级, 值,大于小于信息;(注:其它的布局约束中,设置的值,中间处理过程也是转换成[String:Double]类型)

3,[Any] 中添加 String 值可设置宽度,

[label,200,"50"],

该值处理时转换成[String:String]类型,类型中包含优先级, 值,大于小于信息

4,[Any]中添加[Any] 对象可简易连续添加多个布局束,

[label,200,"50",[ee.T.L]],

[ee.T.L]中包含top, left 的对齐方式,此时表示lable 与lable父视图的top,left对齐;

[ee.T.L,[20,30]]表示top,left 对齐的偏移量 分别是20,30;

[anther_view,ee.T.L,[20,30]],当第一个对象为视图类型的时候,label 的设置布局束是相对于该视图进行设置,否则的话就是想对于父视图进行设置的

[anther_view,ee.B,ee.T,20],label 的顶部与 anther_view的地步对其

easy map 对应信息NSLayoutAttribute.
ee.T —>  NSLayoutAttribute.top,
ee.L —>  NSLayoutAttribute.left

eelay's People

Contributors

zhuxietong avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.