简体   繁体   English

Android DataBinding:查看闪烁

[英]Android DataBinding : View flickering

I am using GridView with image items, loading image via A ndroid DataBinding technology . 我正在使用带有图像项的GridView ,通过A ndroid DataBinding technology加载图像。 If add some new item to list and notify the adapter then the GridView gets flickering why its occur ? 如果添加一些新项目列表并通知适配器,那么GridView会闪烁为什么会发生? if i am not using DataBinding technology then its work fine. 如果我不使用DataBinding技术那么它的工作正常。

如果在列表中使用数据绑定,则应始终调用executePendingBindings() - 这会导致绑定立即执行,而不是等待下一帧(这是导致闪烁的原因)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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