zoukankan      html  css  js  c++  java
  • enyo官方开发入门教程翻译一Layout之Drawers

    Drawers

    onyx.Drawer

    onyx.Drawer是根据open属性来显示或隐藏的controlOpen属性是默认为true(可见)的boolean类型。

    Drawer的显示和隐藏滑动动画方向默认由orient属性决定。Orient的默认值是“v”,表明drawer沿着垂直方向openclose。要创建水平方向的drawer只需将orient属性设置为“h”。

    enyo2.1开始,onyx.Drawer多了一个animated属性,将该属性设置为false可以取消滑动动画。

    Vertical Drawers

    一个实现了垂直drawer的例子:

    enyo.kind({

        name: "VDrawer",

        components: [

            {kind: "FittableRows", classes: "outer-box", components: [

                {content: "Activate Vertical", classes: "inner-box inner-box-v", ontap: "activateDrawer"},

                {name: "drawer", kind: "onyx.Drawer", open: false, components: [

                    {content: "Vertical Drawer<br>Vertical Drawer</br>Vertical Drawer",

                        classes: "inner-box inner-box-v", allowHtml: true}

                ]}

            ]}

        ],

        activateDrawer: function(inSender, inEvent) {

            this.$.drawer.setOpen(!this.$.drawer.open);

        },

    });

    Horizontal Drawers

    例:

    enyo.kind({

        name: "HDrawer",

        components: [

            {kind: "FittableColumns", ontap: "activateColumnsDrawer", classes: "outer-box",

                components: [

                    {content: "Activate Horizontal", classes: "inner-box inner-box-h"},

                    {name: "columnsDrawer", orient: "h", kind: "onyx.Drawer", fit: true, open: false,

                        components: [

                            {content: "Horizontal Drawer Horizontal Drawer",

                                classes: "inner-box inner-box-h"}

                        ]

                    }

                ]

            }

        ],

        activateColumnsDrawer: function(inSender, inEvent) {

            this.$.columnsDrawer.setOpen(!this.$.columnsDrawer.open);

        }

    });

    A Note on CSS

    Css

    .outer-box {

        border: 2px solid orange;

        padding: 4px;

        white-space: nowrap;

        overflow: hidden;

        margin-top: 3px;

        margin-bottom: 3px;

    }

     

    .inner-box {

        border: 2px solid lightblue;

        padding: 4px;

        white-space: nowrap;

        overflow: hidden;

    }

     

    .inner-box-v {

        margin-top: 2px;

        margin-bottom: 2px;

    }

     

    .inner-box-h {

        margin-left: 2px;

        margin-right: 2px;

    }

     

  • 相关阅读:
    [Unity] 如何通过 C# 代码控制角色动画的播放
    [Unity] Unity粒子系统报错: Ensure Read/Write is enabled on the Particle System's Texture.
    [Unity] Shader Graph Error 当前渲染管道与此主节点不兼容(The current render pipeline is not compatible with this master node)
    [运维] 请求 nginx 出现 502 Bad Gateway 的解决方案!
    [排错] SpringBoot 警告 Could not find acceptable representation
    [理解] C++ 中的 源文件 和 头文件
    [经验] 如何将 Java 项目发布到云服务器上并可以访问
    均衡与竞争
    指数退避算法
    判断两个多项式是否为同一个方程
  • 原文地址:https://www.cnblogs.com/waimai/p/2932770.html
Copyright © 2011-2022 走看看