zoukankan      html  css  js  c++  java
  • iOS布局

    1.Masonry 创建constraint来定义布局的方式:
    1.1、 mas_makeConstraints :
    你可以使用局部变量后者属性来保存以便下次应用它
    1.2、 mas_updateConstraints: adding/updating
    有时候你需哟啊更新constraint,而不是创建固定的constraint
    1.3、 mas_remakeConstraints:
    都是跟新constraint,不过,它是删除之前constraint,然后再添加新的
    constraint;


    2. Classy 是一个能与UIkit无缝结合stylesheet系统,借鉴与css思想,但引入新的语法和命名规则
    2.1、 {}:
    $main-color = #e1e1e1;
    MyCustomView{
    background-color:$main-color;
    titile-insets:5,10,5,10;
    >UIProgressView.tinted{
    progress-tint-color:black;
    track-tint-color:yellow;
    }

    }
    ^UIButton.warning, UIView.warning ^UIButton{
    title-color[state:highlighted]:#e3e3e3;
    }

    2.2 默认样式:Classy在应用程序Bundle默认查找文件名为stylesheet.cas的样式文件。

    3. Live Reload:Live Reload是实时显示编写UI代码效果的关键特性,他能够实时检查stylesheet
    文件变化,无需重新编译、构建和运行模拟器,从而极大提高开发速度
    3.1 Style Selecotors 是指定那个View使用那种样式的方式
    3.1.1 Object Class
    3.1.2 View Hierarchy
    3.1.3 Style Class

    3.2 Properties:Classy支持所有UIAppearance的属性和方法,也支持与UIAppearance无关的
    很多属性。Classy使用与UIKit相同属性命名


    4. Keep it DRY
    4.1 Classy提供三种方式避免代码重复:grouping,nesting,variables

  • 相关阅读:
    check_mysql.sh
    shell 数组长度
    Shell脚本中计算字符串长度的5种方法
    非缓冲文件编程(实时操作)
    ferror,clearerr和EOF含义
    密码库生成
    筛选出多个数据并判断
    扫描有分隔符的数据
    unicode文件处理(如果是ANSI编码就不需要了)
    ferror,perror,cleaner
  • 原文地址:https://www.cnblogs.com/Ohero/p/4491374.html
Copyright © 2011-2022 走看看