SwipeRefreshLayout behind ActionBar

前端 未结 6 1634
情深已故
情深已故 2020-12-13 13:10

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

6条回答
  •  既然无缘
    2020-12-13 13:41

    EDIT

    This was the best solution before the v21 of the appcompat-v7 library. If you're using v21 or newer, please check the approved answer. In case you're using appcompat-v7 < 21 API this would still help you.


    You can fix this easily by copying the SwipeRefreshLayout (and its dependencies) into your project and change where the progress bar is displayed, adding a top margin.

    To make it easy for everyone I released a library with the margin implemented. Take a look at this: https://github.com/Naroh091/SwipeRefreshLayoutOverlay

    Hope it helps!

提交回复
热议问题