
就類似這樣的這篇博客可以幫你解決的主要問題就是如何暫停一個動畫并且繼續播放,想明白了實現起來比較簡單但是網上卻沒找到一個讓我滿意的答案/** * Constructor to use when building a TranslateAnimation from code * * @param fromXDelta Change in X coordinate to apply at the start of the * animation * @param toXDelta Change in X coordinate to apply at the end of the * animation * @param fromYDelta Change in Y coordinate to apply at the start of the * animation * @param toYDelta Change in Y coordinate to apply at the end of the * animation */這是官方解釋,也就是我們的動畫的配置要動態改變,這將跟你的RecyclerView的index相關,第一個參數是你初始的位置,第二個是動畫后的位置,index*ItemView的大小即可,代碼不想貼出來了,一是因為你的需要和我的需要不一樣,而是因為希望大家能從別人的博客學到知識作為己用,而不是一味的粘代碼,有問題可以評論可以私聊
新聞熱點
疑難解答