[英]Android Support Design v23 scroll behaviour bug
I have the following situation: 我有以下情况:
One coordinator layout wrapping an AppbarLayout (with content inside) and the other child is a linearlayout that wraps a recycleview. 一个用于包装AppbarLayout(内部包含内容)的协调器布局,另一个用于包装recycleview的线性布局。
I add the appbar_scrolling_view_behavior to the linearlayout in order to react with the scrolls of the recycler but when it reaches the top the first child of the linearlayout sticks on the top. 我将appbar_scrolling_view_behavior添加到linearlayout中,以便与回收器的滚动进行反应,但是当到达顶部时,linearlayout的第一个子项将停留在顶部。
I achieve this, and is still working perfectly with physical devices but not in the emulator. 我实现了这一点,并且仍然可以与物理设备完美协作,但不能在仿真器中正常工作。 It was working in the emulators in the last version of the library.
它正在库的最新版本中的仿真器中运行。
What is happening now is that when I'm trying to open that view, the screen starts to shake and the log output is full of this: 现在发生的是,当我尝试打开该视图时,屏幕开始晃动,并且日志输出中充满了以下内容:
W/EGL_emulation﹕ eglSurfaceAttrib not implemented
W/OpenGLRenderer﹕ Failed to set EGL_SWAP_BEHAVIOR on surface 0xa1584320, error=EGL_SUCCESS
If I place the behavior in the recylcerview then this error is not happening but then I don't get the desired situation. 如果我将行为放在recylcerview中,则不会发生此错误,但是我没有得到所需的情况。
I will open a ticket, but does anyone faced the same situation? 我会开票,但是有人遇到同样的情况吗?
After long debugging I found that the issue is related to the theme together with using coordinator layout and app:layout_behavior="@string/appbar_scrolling_view_behavior"
经过长期调试,我发现问题与主题以及使用协调器布局和
app:layout_behavior="@string/appbar_scrolling_view_behavior"
So if I set this on my theme 因此,如果我将其设置为主题
<item name="android:windowIsFloating">true</item>
With the layout on the previous comment it happens this error. 使用上一个注释的布局时,会发生此错误。
Instead of using windowsIsFloating I set it to false and I force the activity window size 而不是使用windowsIsFloating我将其设置为false,我强制活动窗口大小
getWindow().setLayout(width, height);
Then it works properly. 然后它可以正常工作。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.