我有一个 SwipeRefreshLayout,里面有一个 ListView。我还设置了 ActionBar 叠加层,基本上 ListView 的顶部与 SwipeRefreshLayout 一起位于操作栏后面,当我触发刷新时,动画位于 ActionBar 后面,因此不可见。 有什么想法吗?
最佳答案
在 Material Design 版本的 appcompat-v7 库 (v21.0.0) 中,SwipeRefreshLayout
获取了设置 Progress View 偏移量的方法。
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.
关于android - SwipeRefreshLayout 与 Actionbar 叠加,动画在 actionbar 后面,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24559819/