Android开发中遇到的EditText在ListView中的键盘焦点问题,网上解决方法很多,但是都比较麻烦,其实==最简单的解决方案==就是:
- 用RecyclerView,参见:bigsinger/EditTextInRecyclerView,注意控件不要用这个属性:
android:descendantFocusability=”blocksDescendants”
其他,有说要在RecyclerView控件中添加:
android:descendantFocusability="beforeDescendants"
android:fastScrollEnabled="false"
所在activity的AndroidManifest.xml属性添加:
android:windowSoftInputMode="stateHidden|adjustPan"
貌似不加也可以。
本文介绍了一个简单的解决方案来解决Android开发中EditText在ListView内的键盘焦点问题。推荐使用RecyclerView替代ListView,并给出了具体的实现建议。
639

被折叠的 条评论
为什么被折叠?



