问题
I'm suprised by Android code sometimes. As the title asks;
Why does a RecyclerView.LayoutManager's
default smoothScrollToPosition
method write a Log.e
message instead of throwing an exception?
(This is in the support v7 library, 24.0.0)
public void smoothScrollToPosition(RecyclerView recyclerView, State state, int position) {
Log.e(TAG, "You must override smoothScrollToPosition to support smooth scrolling");
}
I would expect this method to throw an exception since whoever called this method obviously didn't implement the required methods/classes.
来源:https://stackoverflow.com/questions/38391869/why-does-a-recyclerview-layoutmanagers-default-smoothscrolltoposition-method-lo