1

I have a view in Sencha Touch that contains many different labels and buttons. I have styled them in my custom.css file to how I want them to look. I want to hide everything but one button, so that when the button is clicked, the elements will appear. I added to those elements "hidden: true." However, the CSS is ignored and the styling is awful. Is there any way to preserve the CSS? I saw I could use 'hiddenCls" but I cannot figure out how to use it. Any ideas? Thanks!

Below is my code so far:

Ext.define('myApp.view.StartScreen', {
extend: 'Ext.Container',
xtype: 'startscreen',

config: {
    layout: {
        type: 'vbox',
        align: 'middle'
    },

    items: [{
        xtype: 'toolbar',
        docked: 'top',
        title: 'My App',
        items: [{
            xtype: 'button',
            iconMask: true,
            iconCls: 'refresh',
            width: 42
        }, { xtype: 'spacer' }, {
            xtype: 'button',
            iconMask: true,
            iconCls: 'user'
        }]
    }, {
        xtype: 'label',
        html: 'Discussions',
        cls: 'item-title-label',
        name: 'itemTitleLabel',
        hidden: true,
        hiddenCls: 'x-item-title-label-hidden'
    }, {
        xtype: 'label',
        html: 'Hi',
        cls: 'case-number-label',
        name: 'caseNumberLabel',
        hidden: true,
        hiddenCls: 'x-case-number-label-hidden'
    }, {
        xtype: 'label',
        html: '0:00',
        cls: 'duration-label',
        name: 'durationLabel',
        hidden: true,
        hiddenCls: 'x-duration-label-hidden'
    }, {
        xtype: 'label',
        html: 'Started at 13:42',
        cls: 'time-started-label',
        name: 'timeStartedLabel',
        hidden: true,
        hiddenCls: 'x-time-started-label-hidden'
    }, {
        xtype: 'button',
        text: 'Start',
        ui: 'confirm',
        cls: 'big-start-button',
        name: 'bigStartButton'
    }, {
        xtype: 'button',
        text: 'Off',
        ui: 'decline',
        cls: 'big-off-button',
        name: 'bigOffButton',
        hidden: true,
        hiddenCls: 'x-off-button-hidden'
    }]
}

});

4

1 回答 1

1

尝试visiibility在要隐藏的元素上使用 css 属性,如visibility:hidden.

于 2013-05-12T00:04:59.977 回答