android – SwipeRefreshLayout后面ActionBar

当使用SwipeRefreshLayout与叠加模式ActionBar组合时,加载动画将显示在操作栏后面,使其几乎不可见。

有什么我可以做的显示在操作栏的顶部吗?

在appcompat-v7库(v21.0.0)的Material Design版本中,SwipeRefreshLayout获取一个方法来设置进度视图偏移量。

https://developer.android.com/reference/android/support/v4/widget/SwipeRefreshLayout.html#setProgressViewOffset(boolean,%20int,%20int)

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.

http://stackoverflow.com/questions/24413680/swiperefreshlayout-behind-actionbar

本站文章除注明转载外,均为本站原创或编译
转载请明显位置注明出处:android – SwipeRefreshLayout后面ActionBar