在Fragment中使用NestedScrollView嵌套RecyclerView時,如果來回切換Fragment就可能會造成界面直接滑動到Recyclerview的第一個Item,
解決方案:
在NestedScrollView的第一個父布局中添加如下屬性,強制獲得焦點
android:descendantFocusability="blocksDescendants" android:focusable="true" android:focusableInTouchMode="true"
轉載請註明出處,本文鏈接:https://www.uj5u.com/yidong/304974.html
標籤:其他
上一篇:Arouter實作界面跳轉和傳參
