How to Give a Overlay Panel in sencha touch a transparent background

我怕爱的太早我们不能终老 提交于 2019-12-10 10:48:55

问题


The code below only changes the color of the border around the panel but not the panel itself.

var overlay = Ext.Viewport.add({                
    xtype: 'panel',
    centered: true,
    style:'background-color: transparent;',
    modal: {
        style: 'opacity: 0'
    },
    hideOnMaskTap:true,
    width:'20%',
    height: '50%',
    styleHtmlContent:true,
    items:[{
        xtype:'button',
        test:'hey',
        cls:'notrans',
        style: 'opacity: 1'
    }]
});             

回答1:


You need to change the x-panel-inner cls for your panel when it is centered. So what you want to do is give your panel a cls e.g: cls: my-panel.

var overlay = Ext.Viewport.add({
    xtype: 'panel',
    centered: true,
    style:'background-color: transparent;',
    cls: 'my-panel',
    ....
});             

Now in your custom stylesheet:

.my-panel .x-panel-inner {
    background-color: transparent !important;
}

So now your centered panel should have its background transparent.



来源:https://stackoverflow.com/questions/15456061/how-to-give-a-overlay-panel-in-sencha-touch-a-transparent-background

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!