Overlaying in list items with Sencha Touch app

ε祈祈猫儿з 提交于 2019-12-12 01:03:12

问题


I am developing a Sencha Touch app with lists, specifically in one list we have (for example) 400 different items and it is necessary to include the parameter infinite: true to improve the performance in the view..

But I am looking a strange behavior and the items are overlaying with the next one..

My code is:

xtype        : 'list',
cls          : 'mweb-list',
useComponents: true,
maxItemCache: 30,
useHeaders   : false,
infinite   : true,

This behavior is happening when I include the infinite parameter..

Component cls has not css rules, here you can view the extended component:

Ext.define('xx.components.list.BaseListComponent', {
  extend: 'Ext.dataview.List',
  xtype : 'mwebBaseListComponent',

  config: {
    cls          : 'mweb-list',
    useComponents: true,
    emptyText    : '',
    loadingText  : '',
    useHeaders   : false
  }
});

Any clue??

Thank you in advance.


回答1:


You might want to use the flag variableHeights:true.

xtype        : 'list',
cls          : 'mweb-list',
useComponents: true,
maxItemCache: 30,
useHeaders   : false,
infinite   : true,
variableHeights: true,

Other than that your mweb-list might be setup for normal lists, but not following the structure of infinite lists. If variableHeights does not help please post your css code.

css:

.mweb-list {
    --> post whatever is in here
}



回答2:


When you use infinite: true, you can use the itemHeight property to set the height (in pixels) of each list item.

xtype        : 'list',
cls          : 'mweb-list',
useComponents: true,
maxItemCache: 30,
useHeaders   : false,
infinite   : true,
itemHeight : 80


来源:https://stackoverflow.com/questions/36303531/overlaying-in-list-items-with-sencha-touch-app

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