使用滑动刷新布局时的视觉错误

Visual bug when using Swipe Refresh Layout

我在 Recycler 视图中使用滑动刷新布局。当用户拉动足够的滑动刷新并出现圆圈并在不调用 onRefresh 函数的情况下推回时,圆圈的小和平仍然看到照片。 我使用透明的应用程序栏,但即使没有它,问题仍然存在。

您尝试过在 OnRefreshListener 中使用 setRefreshing(false) 吗?

通过设置解决 swipeRefreshLayout.setProgressViewOffset(false,0,50);

public void setProgressViewOffset (boolean scale, int start, int end)

The refresh indicator starting and resting position is always positioned near the top of the refreshing content. This position is a consistent location, but can be adjusted in either direction based on whether or not there is a toolbar or actionbar present.

Parameters

scale Set to true if there is no view at a higher z-order than where the progress spinner is set to appear.

start The offset in pixels from the top of this view at which the progress spinner should appear.

end The offset in pixels from the top of this view at which the progress spinner should come to rest after a successful swipe gesture.