当显示软键盘时,Android将调整布局的一部分
我想从图像中创建一个正常情况下的布局,并在下一幅图像中显示少量编辑文本当显示软键盘时,Android将调整布局的一部分,android,android-layout,keyboard,Android,Android Layout,Keyboard,我想从图像中创建一个正常情况下的布局,并在下一幅图像中显示少量编辑文本 但当用户开始输入文本时,我需要下一步更改布局: 屏幕底部的软键盘, 编辑有关它的文本,但图像会根据此处显示的软键盘大小调整大小 我怎么做? 提前感谢尝试此代码 <LinearLayout android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical"
但当用户开始输入文本时,我需要下一步更改布局:
屏幕底部的软键盘,
编辑有关它的文本,但图像会根据此处显示的软键盘大小调整大小
我怎么做? 提前感谢尝试此代码
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<ImageView
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"/>
<EditText
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
<EditText
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
</LinearLayout>
作为
AndroidManifest.xml
中活动的属性,将它们放在滚动视图中,并确保在清单中为相应的活动添加“adjustResize”。但我不需要滚动,我需要适合整个屏幕的布局
android:windowSoftInputMode="adjustResize"