远程ListView控件闪烁在Android窗口小部件控件、部件、窗口、ListView

2023-09-03 21:55:44 作者:干涸的记忆 さ

我有一个意想不到的困扰问题,远程列表视图。我的应用程序有一个简单的小工具,其中包括列表视图。如果列表视图有1个单元格高度和列表视图是在其滚动它闪烁的开始/ flahses每次datasetchanged被调用。有趣的是,如果列表视图有超过1单元高度,或者如果它有1个单元格的高度,但它已经向下滚动了一下它不闪烁。 有谁请提供一些建议吗?我很沮丧。 解决方案我曾经想过到目前为止: 1.禁用加载视图(这是什么原因造成的闪光)上的remoteViewFactory。不过,我不知道如何做到这一点。甚至不知道它是否会工作。

I am having an unexpected bothering issue with a remote listview. My app has a simple widget which includes a listview. If the listview has 1 cell height and the listview is at the beginning of its scroll it blinks/flahses everytime datasetchanged is called. The funny thing is that if the listview has more than 1 cell height or if it has 1 cell height BUT it has been scrolled down a bit it doesnt blink. Could anybody please provide some suggestion? I am frustrated. Solutions I have thought so far: 1. Disable loading view (which is what is causing the flash) on the remoteViewFactory. However I dont know how to do this. Dont even know if it would work.

非常感谢你。

推荐答案

好,我找到了解决问题的闪烁,同时点击小部件。例如,如果你看一下YouTube应用程序在Android中,你可能会认识到它会等待你直到它打开。在下面,你可以尝试设置安卓windowDisable preVIEW 为真的在 style.xml 。我相信,谷歌用同样的方法prevent preVIEW在YouTube应用模式。

Ok I found a solution to blinking problem while clicking the widget. For example if you look at youtube app in android, you might recognize it waits you until its open. In below, you may try to set android:windowDisablePreview to true in your style.xml. I believe Google used same method to prevent preview mode in Youtube app.

<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
        <item name="android:actionBarStyle">@style/Widget.AppCompat.ActionBar</item>
        <!-- closed the preview window -->
        <item name="android:windowDisablePreview">true</item>

    </style>

我希望这个解决方案可以帮助你。

I hope this solution helps you.

 
精彩推荐
图片推荐