android - SwipeRefreshLayout 与 Actionbar 叠加,动画在 actionbar 后面

标签 android android-actionbar overlay android-animation swiperefreshlayout

我有一个 SwipeRefreshLayout,里面有一个 ListView。我还设置了 ActionBar 叠加层,基本上 ListView 的顶部与 SwipeRefreshLayout 一起位于操作栏后面,当我触发刷新时,动画位于 ActionBar 后面,因此不可见。 有什么想法吗?

最佳答案

在 Material Design 版本的 appcompat-v7 库 (v21.0.0) 中,SwipeRefreshLayout 获取了设置 Progress View 偏移量的方法。

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.

关于android - SwipeRefreshLayout 与 Actionbar 叠加,动画在 actionbar 后面,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24559819/

相关文章:

android - imageView.setImageBitmap 在 Android 中不起作用

android - android wear 的全屏背景图片大小

android - 从服务器获取数据后如何将数据存储在房间数据库中

java - Android:隐藏特定 Activity 的 ActionBar

html - 在CSS中动态获取导航栏的高度

html - 自定义删除线 CSS

java - 在 API 19 设备上膨胀 TextInputEditText 时出错

Android Action Bar (Sherlock Action Bar) - 将下拉微调器一直定位到右侧

android - SearchView.isFocused 总是返回 false

image - 在 javafx 中创建图像覆盖掩码