Android: Detect when ScrollView has finished scrolling and bouncing back?

后端 未结 1 1263
陌清茗
陌清茗 2021-02-09 06:23

I have a ScrollView which has two hidden images, one at the top and one at the bottom. In between there is a bunch of visible content.

What I need to do is make these i

相关标签:
1条回答
  • 2021-02-09 06:56

    You can use an OnTouchListener to detect when the user presses/releases the list.

    You can also use the onScrollStateChanged method of the OnScrollListener class (most likely in conjunction with a touch listener) to detect changes in the SCROLL_STATE - when the list has stopped scrolling the state will change from a state that is not SCROLL_STATE_IDLE to SCROLL_STATE_IDLE.

    Alternatively if you are using 2.3 or above you can use an OverScroller to get the desired effect (see Modifying Android OverScroll for how to change the over scroll effect to an iPhone like one).

    0 讨论(0)
提交回复
热议问题