简体   繁体   中英

Overlaying in list items with Sencha Touch app

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.

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

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
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM