zoukankan      html  css  js  c++  java
  • conditions条件判断

    conditions可以根据条件绑定样式或者数据

    type ==、!=、
    left 条件左值
    right 条件右值
    executionType 条件执行类型,支持 0 和 1 两个值。0 标识该条件满足并执行后跳出条件列表,1 表示当前条件满足并执行后不跳出条件列表,继续向下执行。默认情况是0,即到某个条件满足并执行后即跳出条件列表。

    单个条件:

    <condition type="==" left="$mk_margin" right="4"><styleBinding height="32" /></condition>

    且:

    <andCondition>
        <condition type="==" left="$mk_margin" right="9"/>
        <condition type="!=" left="$diy_margin" right="null"/>
        <styleBinding height="$diy_margin" />
    </andCondition>

    完整实例:

    <ui>
      <view>
        <container>
          <editProperty>
            <dataDefines>
              <dataDefine name="mk_margin" type="select" propertyName="模块下边距">  
                <config type="sync">
                   <data text="8" value="1" defaultSelect="true" />
                   <data text="32" value="4" defaultSelect="false" />
                   <data text="自定义" value="9" defaultSelect="false" />
               </config>
           </dataDefine>
           <dataDefine type="text" propertyName="自定义边距" name="diy_margin" refer="mk_margin:9" isNull="true"/>
       </dataDefines>
    </editProperty>
    <subViews>
     <container>
       <layout type="linearLayout"/>
       <!--默认边距为8-->
       <styleBinding width="640" height="8" backgroundColor="#ff0000" marginTop="0"/>
        <!--条件判断-->
       <conditions>
        <!--如果下拉菜单值为9且自定义边距不为空,则高度为自定义高度-->
          <andCondition>
            <condition type="==" left="$mk_margin" right="9"/>
            <condition type="!=" left="$diy_margin" right="null"/>
            <styleBinding height="$diy_margin" />
        </andCondition>
         <!--如果下拉菜单值为4,则高度为32-->
        <condition type="==" left="$mk_margin" right="4"><styleBinding height="32" /></condition>
    </conditions>   
    </container>    
    </subViews>
    </container>
    </view>
    </ui>
  • 相关阅读:
    nginx+vue刷新404
    java-Object类的解析(持续更新)
    Python源码学习(六)-PyCodeObject初探
    经典算法之不定方程问题
    MySql中的视图的概念及应用
    数据结构之 折半插入排序
    mahout算法源码分析之Itembased Collaborative Filtering实战
    【Android】为Android虚拟机创建SDCard
    30个酷毙的交互式网站(HTML5+CSS3)
    项目总结——也谈svn版本库迁移
  • 原文地址:https://www.cnblogs.com/tinyphp/p/13593735.html
Copyright © 2011-2022 走看看