[解決済み] Vadym のおかげで、Sencha には独自の margin プロパティがあり、これが役に立ちました。
幅が「320px」の Ext.dataview.List があります。私が今しなければならないことは、これらの固定 320px (このリスト) を、どの解像度の画面の中央にも配置することです。
評判のせいで写真をお見せできないので、別の言葉で繰り返して少しスケッチします。
リストを画面の中央に配置する必要があります。
I have it like this now - docked at the left side:
_________________________________________
||list item 1 | |
||list item 2 | |
||list item 3 | |
||list item 4 | |
What I want to accomplish is this - centered in the middle:
_________________________________________
| |list item 1 | |
| |list item 2 | |
| |list item 3 | |
| |list item 4 | |
仕事をすることができると思ったリストの構成値を見つけました-中心-しかし、この値をtrueに設定すると、リストは完全に消えます。
私のコードはこれだけです:
Ext.define('GeoFun.view.Ukoly', {
extend: 'Ext.dataview.List',
xtype: 'ukolylist',
initialize: function () {
this.callParent(arguments);
},
config: {
ui: 'round',
width: '320px',
//centered: true, -- doesn't work
itemTpl: Ext.create(
'Ext.XTemplate',
'<div class="listItemContainer">',
' I need this list to be in center of the screen.',
'</div>')
}
});
前もって感謝します。