在setadapter的时候,Listview会自己拿到焦点,跳转到最上面。怎么不让listview拿到焦点呢?
不考虑的方法:1.把焦点给其他控件2.把布局写成Listview的header
业精于勤,荒于嬉;行成于思,毁于随。
Found a way. Use setFocuse to determine whether the user clicked it.
Call ListView.setAdapter(...) first when the page opens
Refresh data through Adapter.notifyDataChanged()
ListView焦点引起的问题基本无解, 即便处理了, 还是会有不适应的情况. 连ListView滚动时都会获取focus. 所以, 尝试下RecyclerView, 并调用RecyclerView.setFocusable(false).
ListView
RecyclerView
RecyclerView.setFocusable(false)
Found a way.
Use setFocuse to determine whether the user clicked it.
Call ListView.setAdapter(...) first when the page opens
Refresh data through Adapter.notifyDataChanged()
ListView
焦点引起的问题基本无解, 即便处理了, 还是会有不适应的情况. 连ListView
滚动时都会获取focus. 所以, 尝试下RecyclerView
, 并调用RecyclerView.setFocusable(false)
.