zoukankan      html  css  js  c++  java
  • PureLayout(轻量级自动布局)

    直接整理用法

    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];

     

     

  • 相关阅读:
    vs与linux的交叉编译环境搭建
    layui框架部分功能介绍
    谷歌添加百度翻译提示Google已将百度翻译标记为恶意程序并阻止安装,怎么办
    七,JOBC数据库编程
    mysql数据库
    六,IO系统
    五,图形界面编程
    四,集合框架
    三,反射类
    二,常用类
  • 原文地址:https://www.cnblogs.com/huoran1120/p/5470807.html
Copyright © 2011-2022 走看看