从 PreferenceFragmentCompat 片段导航时查看故障 [英] View glitch when navigating from PreferenceFragmentCompat fragment
问题描述
我有一个我无法弄清楚的奇怪错误.我有 3 个片段并使用 Android 导航在它们之间导航.一切都很完美,但是一旦我转到可以访问首选项的设置片段并导航回具有列表视图的主片段,ListAdapter 项中的一个 TextView 就会出现此突出显示几秒钟,然后它就消失了.从现在开始,每当我从任何片段导航回这个片段时,都会出现高亮显示,直到我重新启动应用程序.
I have this weird bug that I can't figure out. I have 3 fragments and use Android Navigation to navigate between them. Everything works perfect, but as soon as I go to settings fragment that has access to preferences and navigate back to main fragment which has list view, one TextView in ListAdapter item has this highlight happen for a few seconds and then it's gone. From now on whenever I navigate from any fragment back to this one, the highlight happens, until I restart the app.
有什么想法吗?
推荐答案
所以我找到了解决方案.
So I found the solution.
将 MaterialCardView 或顶部布局高度更改为 wrap_content.
Changed MaterialCardView or top layout height to wrap_content.
或者
将 Preference 库降级到 1.1.0-aplha01 也可以解决.
Downgrading Preference library to 1.1.0-aplha01 solves it too.
这篇关于从 PreferenceFragmentCompat 片段导航时查看故障的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!