【发布时间】:2016-10-06 18:39:49
【问题描述】:
当我在编辑文本中有焦点时显示键盘有问题。我想在我显示我的屏幕后第一次移除焦点。任何专业人士都可以帮助我。太感谢了。
【问题讨论】:
标签: android android-edittext focus
当我在编辑文本中有焦点时显示键盘有问题。我想在我显示我的屏幕后第一次移除焦点。任何专业人士都可以帮助我。太感谢了。
【问题讨论】:
标签: android android-edittext focus
设置父布局的属性
android:focusable="true"
android:focusableInTouchMode="true"
像这样:
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:background="@color/black"
android:gravity="center_horizontal"
android:focusable="true"
android:focusableInTouchMode="true">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/logo"
android:background="@drawable/dictionary_logo"/>
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/searchbar_bg"
android:gravity="center_vertical">
<EditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/et_search"
android:background="@null"
android:hint="Search"
android:singleLine="true"/>
</RelativeLayout>
</LinearLayout>
【讨论】: