I have 2 AutoCompleteTextViews
在一个活动(LinearLayout)和几个additional controls
(单选组、按钮等)。不知何故,AutoCompleteTextViews 是never losing focus
.
例如:
用户单击 AutoCompleteTextView,控件获得焦点。因此,光标开始闪烁,显示自动完成下拉列表和键盘。这可以。
然而,如果user now clicks on of the radio buttons
(或其他控件),光标在 AutoCompleteTextView 中is still blinking
并且键盘仍然显示。
如何让焦点自动消失?
EDIT:xml代码
<AutoCompleteTextView
android:id="@+id/ediFrom"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:singleLine="true"
android:text="" />
唯一对我有用的解决方案是添加这一行
android:focusable="true"
android:focusableInTouchMode="true"
到 AutoCompleteTextView 的父级(如 LinearLayout 等..)
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)