SwipeRefreshLayout背后的动作条 [英] SwipeRefreshLayout behind ActionBar

查看:315
本文介绍了SwipeRefreshLayout背后的动作条的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当使用组合SwipeRefreshLayout与叠加模式的ActionBar,加载动画将在动作条的背后显示的,使得它几乎看不见。

When using a SwipeRefreshLayout in combination with a overlay mode ActionBar, the loading animation will be displayed behind the actionbar, making it almost invisible.

有什么我可以做,以显示它在动作条的顶部?

Is there anything I can do to show it on top of the actionbar?

推荐答案

在材料设计版本appcompat-V7库(v21.0.0)的, SwipeRefreshLayout 得到一个方法来设置进度视图偏移。

In the Material Design version of the appcompat-v7 library (v21.0.0), SwipeRefreshLayout gets a method to set the Progress View offset.

<一个href="https://developer.android.com/reference/android/support/v4/widget/SwipeRefreshLayout.html#setProgressViewOffset(boolean,%20int,%20int)">https://developer.android.com/reference/android/support/v4/widget/SwipeRefreshLayout.html#setProgressViewOffset(boolean,%20int,%20int)

公共无效 setProgressViewOffset (布尔规模,诠释开始,诠释完)

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

刷新指示器起始和休息位置总是位于靠近清爽内容的顶部。这个位置是一致的位置,但是可以基于是否有一个工具栏或动作条present在任一方向进行调整。

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.

参数

比例的设置为true,如果没有视图在一个更高的Z顺序比在该进度微调器设置出现。

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.

这篇关于SwipeRefreshLayout背后的动作条的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆