美文网首页
轻量级自动布局框架PureLayout

轻量级自动布局框架PureLayout

作者: cj2527 | 来源:发表于2016-10-27 16:46 被阅读84次

1.设置高度宽度
[view1 autoSetDimension:ALDimensionHeight toSize:70.0];
[view1 autoSetDimension:ALDimensionWidth toSize:70.0];

2.相对于父视图
ALEdgeInsets defInsets = ALEdgeInsetsMake(20.0,20.0,20.0,20.0);
[view1 autoPinEdgesToSuperviewEdgesWithInsets:defInsets];
相当于下面的写法
[view1 autoPinEdgeToSuperviewEdge:ALEdgeLeft withInset:20.0];
[view1 autoPinEdgeToSuperviewEdge:ALEdgeRight withInset:20.0];
[view1 autoPinEdgeToSuperviewEdge:ALEdgeTop withInset:20.0];
[view1 autoPinEdgeToSuperviewEdge:ALEdgeBottom withInset:20.0];

相对于父视图除了某一个
[view1 autoPinEdgesToSuperviewEdgesWithInsets:defInsets excludingEdge:ALEdgeBottom];

3.两个视图的相对位置
[view2 autoPinEdge:ALEdgeTop toEdge:ALEdgeBottom ofView:view1 withOffset:defInsets.bottom];

4.同宽同高
[@[view1,view2]autoMatchViewsDimension:ALDimensionHeight];可以设置多种
[view1 autoMatchDimension:ALDimensionHeight toDimension:ALDimensionHeight ofView:view2];

5.水平对齐垂直对齐
[view1 autoAlignAxis:ALAxisHorizontal toSameAxisOfView:view2];
[view1 autoAlignAxis:ALAxisVertical toSameAxisOfView:view2];

相关文章

  • 轻量级自动布局框架PureLayout

    1.设置高度宽度[view1 autoSetDimension:ALDimensionHeight toSize:...

  • 使用Masonry代码进行屏幕适配的详细介绍

    Masonry自动布局使用 Masonry是一个轻量级的布局框架,采用更好的语法封装自动布局,它有自己的布局DSL...

  • iOS URL encode与decode 笔记

    Encode: Decode: 一款轻量级的布局框架,自动布局 https://github.com/xjh093...

  • 源码解读——Masonry

    原文链接 Masonry 概述 Masonry 是基于 Apple 的自动布局封装的一个轻量级布局框架。Mason...

  • Masonry学习笔记

    Masonry Masonry是一个轻量级的布局框架,采用链式语法封装自动布局,简明,高可读。 通常leading...

  • 【iOS】自动布局之Purelayout

    masonry这个第三方库件在github上很出名,貌似也很好用,但是我在看过masonry的介绍和使用方法之后,...

  • Masonry 学习笔记

    一个轻量级的布局框架, 同时支持 iOS 和 Mac OS X, 采用更优雅的链式语法封装自动布局,语法优雅, 帮...

  • Masonry自动布局使用

    Masonry是一个轻量级的布局框架,采用更好的语法封装自动布局,它有自己的布局DSL。简洁明了并具有高可读性 而...

  • 探究 Masonry 源码

    Masonry 是一个轻量级自动布局框架,开发者可以使用更简洁的链式语法为控件进行布局。Masonry 的使用可以...

  • Masonry

    1、什么是Masonry Masonry是一个轻量级的布局框架。采用链式语法封装自动布局,简洁明了并具有高可读性,...

网友评论

      本文标题:轻量级自动布局框架PureLayout

      本文链接:https://www.haomeiwen.com/subject/rthsuttx.html