0

2行分のスペースを確保するために、リスト内のリスト項目の最小高を100ピクセルにしようとしています

.x-list .x-list-item 
{
    min-height: 500px; /*exaggeration just to see if it works
    background-color: red;
}

背景の赤が表示されていますが、最小高さは影響を受けていません。これは、クロムの「要素の検査」をチェックしたときに、重要な css 値がどこかにあるためと思われます

<div class="x-list-item-first x-list-header-wrap x-list-item-last x-list-footer-wrap x-list-item x-stretched x-list-item-tpl x-list-item-relative" id="ext-simplelistitem-1" style="min-height: 42px !important;"><div class="x-unsized x-list-disclosure" id="ext-component-6"></div><div class="x-innerhtml" id="ext-element-81"><div class="list-item-title">Title = Unsaved feed title</div> <div class="list-item-narrative">Unsaved feed narrative</div>  </div></div>

style="min-height: 42px !importantcssファイルからのものではないため、ビットがどのように表示されているかわかりません-フォルダーを徹底的にチェックしました

4

2 に答える 2

1

これを試すことができます:

{
                xtype: 'list',
                itemTpl: '{title}',
                itemHeight: 100,
                data: [
                    {title: 'Item 1'},
                    {title: 'This is just a sample piece of code. Try this. It is fitting well.'},
                    {title: 'Item 3'},
                    {title: 'Item 4'}
                ]
}

を設定するだけで済みますitemHeight。これにより、デフォルトのアイテムの高さを設定でき、リストを埋めるために必要なアイテムの量を大まかに計算するために使用されます。デフォルトでは、アイテムの高さは約 50px です。

デフォルト: 42 。それでおしまい。ハッピーコーディング。:)

于 2014-06-05T05:50:43.833 に答える
0

リスト テンプレートの親 div に設定min-heightします。

itemTpl: new Ext.XTemplate(
        '<div style="min-height:100px;">',
        // ... your elements
        '</div>')
于 2014-06-04T22:11:21.080 に答える