Android 编辑文本和搜索按钮缩小并超出范围
我有下面的布局Android 编辑文本和搜索按钮缩小并超出范围,android,android-edittext,Android,Android Edittext,我有下面的布局 <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height=
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
android:orientation="vertical"
tools:context="com.example.android.booklistings.MainActivity">
<RelativeLayout
android:layout_weight="2"
android:layout_width="match_parent"
android:layout_height="0dp">
<EditText
android:id="@+id/search_text"
android:layout_marginTop="10dp"
android:imeOptions="actionSearch"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:hint="Type the name of book"
android:inputType="text"/>
<ImageButton
android:layout_toRightOf="@id/search_text"
android:layout_toEndOf="@id/search_text"
android:id="@+id/search_button"
android:adjustViewBounds="true"
android:scaleType="centerCrop"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/search" />
</RelativeLayout>
<ListView
android:layout_weight="8"
android:id="@+id/book_list"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="0dp">
</ListView>
</LinearLayout>
我不明白为什么当屏幕上弹出键盘时,我看不清编辑框!我有listview和edittext。如果我键入一些内容并按下搜索按钮,则listview将被填充,并将通过我的自定义适配器填充许多视图
当键盘出现在屏幕上时,我看不到编辑框列表视图很好。你看不到你的
编辑文本,因为它随着软键盘弹出而上移
要停止这种移动行为,必须包括以下内容:
android:WindowsofInputMode=“adjustPan | adjustResize”
在清单文件的相应活动标记中。为edittext指定一些宽度或使其宽度与父项匹配。如果使用“匹配父项”,则按钮将消失。。;同时给imagebutton一些宽度或匹配\u parents在
imagebutton
中使用android:adjustViewBounds=“true”的目的是什么?试着删除它你说看不到编辑文本是什么意思?请再解释一下?你想得到什么。