ListView exceeding parent area [duplicate]

爷,独闯天下 提交于 2019-12-25 07:59:49

问题


I'm using ListView and I'm loading that onto a Rectangle. While scrolling the content up or down the content is not correctly hidden and remains visible to the user. Can someone help me on this issue?


回答1:


As reported by the documentation:

Note: Views do not enable clip automatically. If the view is not clipped by another item or the screen, it will be necessary to set clip: true in order to have the out of view items clipped nicely.

Hence, what you are experiencing is a common behaviour and you should either 1) clip the view via other Items (e.g. a header Rectangle and a footer Rectangle with z:infinite or simply set the clip property to true, i.e.

ListView{
   //...
   clip:true
   //...
}

Clipping has some perfomance disavantages which can greatly affect the application as it grows. Hence, its usage, especially outside the views scenario, should be evaluated carefully.



来源:https://stackoverflow.com/questions/40482081/listview-exceeding-parent-area

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