How to remove focus from RecyclerView inside ScrollView?

前端 未结 5 1390
傲寒
傲寒 2020-12-05 07:37

I have a Scrollview which contains an ImageView and RecyclerView. if navigation drawer opened then closed the RecyclerView auto scrolling to top, How to stop this?



        
5条回答
  •  盖世英雄少女心
    2020-12-05 08:29

    This problem because of recyclerView has default focus.

    Solution

    
    

    Add android:descendantFocusability="blocksDescendants" to your immediate layout of scrollView

提交回复
热议问题