发布时间: 2017-08-29 13:09:00
参考:https://stackoverflow.com/questions/16886077/android-scrollview-doesnt-start-at-top-but-at-the-beginning-of-the-gridview/21235114#21235114
原因:
recycleview会自动focus , 所以会把页面拖到底部。
办法:
在代码中(记得不能在xml中)对该 recycleview 加上如下语句:
recyclerView = (RecyclerView) rootView.findViewById(R.id.recycler_view); // 让页面置顶 recyclerView.setFocusable(false);