Android drop-down refresh swiperefreshlayout control usage

We know that the current material design is very popular, and swipererefreshlayout is a native effect (also a Facebook pull-down refresh effect). Swipererefreshlayout is a pull-down refresh control, which can wrap almost any scrollable content (listview GridView Scrollview recyclerview), and can automatically recognize the vertical scroll gesture. It is very convenient to use.

It is powerful enough to have many child views to inherit, which can achieve different effects (not studied by bloggers)

If you don't say much, look at the picture first

See the little green circle above? This is the Facebook pull-down REFRESH!

Code implementation:

1. Add in layout file

2. Reference in Java file:

Some additional instructions for swiperefreshlayout

1. Manually call the refreshed animation through setrefreshing (false) and setrefreshing (true).

2. The onrefresh callback can only be triggered when the gesture is pulled down. Setrefreshing can only call whether the refreshed animation is displayed. Swiperefreshlayout can also be placed in coordinatorlayout to jointly handle sliding conflicts. If you are interested, you can try.

The above is the whole content of this article. I hope it will be helpful to your study, and I hope you can support programming tips.

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>