1
void jumpTo (int targetPosition)
Instead of specifying pixels to scroll, use the target position to jump using scrollToPosition(int).

You may prefer using this method if scroll target is really far away and you prefer to jump to a location and smooth scroll afterwards.

Note that calling this method takes priority over other update methods such as update(int, int, int, Interpolator), setX(float), setY(float) and #setInterpolator(Interpolator). If you call jumpTo(int), the other changes will not be considered for this animation frame.

RecyclerView から「jumpTo(targetPosition)」を呼び出す方法を探しています。現在、「LinearLayoutManager.scrollToPositionWithOffset(position,offset)」を使用していますが、位置が画面に表示されていない場合に常に実行されるとは限りません。

例えば。- listSize = 100 - 現在画面上/可視 19,20,21,22,23 - scrollToPositionWithOffset(30,0) //FAIL - scrollToPositionWithOffset(22,0) //成功

4

1 に答える 1