【问题标题】:How to change the background color of the grouped heading in List in sencha touch 2?如何在sencha touch 2中更改列表中分组标题的背景颜色?
【发布时间】:2012-08-01 07:38:00
【问题描述】:

我有一个包含 2 个组的列表。我想覆盖列表中给定组的标题的默认背景颜色。如何在sencha touch 2中更改List中分组标题的背景颜色?

【问题讨论】:

    标签: css sencha-touch extjs sencha-touch-2


    【解决方案1】:

    您可以通过将自己的类添加到列表中并使用 chrome 开发者工具查找定义标题样式的类名来轻松做到这一点。

    将 cls 添加到列表中

    {
        xtype: 'list',
        itemTpl: '<div class="contact2"><strong>{firstName}</strong> {lastName}</div>',
        disclosure: true,
        grouped: true,           
        cls:'customHeader',
        store: store
    }
    

    添加如下css样式

    .customHeader .x-list-header {
        background-color: red;
        background-image: none;
        border-color: red;
        color: beige;
    }
    

    要根据模型值更改标题颜色,Sencha FiddleJSFiddle 可能会给你一个想法。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2013-03-18
      • 2013-11-19
      • 1970-01-01
      • 2019-11-13
      • 2012-02-15
      • 2017-09-19
      • 2013-01-03
      相关资源
      最近更新 更多