小编Far*_*C K的帖子

Android软键盘浮动只有特定的布局

我有一个布局,代码如下

<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
xmlns:app="http://schemas.android.com/apk/res-auto">
<!--some stuff here-->

<LinearLayout
    android:id="@+id/layout1"
    android:layout_alignParentBottom="true"
    android:layout_above="@+id/layout2"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:orientation="horizontal">
    <EditText
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        android:layout_weight="5"
        />
    <ImageButton
        android:layout_width="50dp"
        android:layout_height="50dp"
        android:scaleType="fitStart"
        android:layout_marginLeft="5dp"
        style="@style/Base.Widget.AppCompat.Button.Borderless"
        android:src="@drawable/ic_menu_send"/>
</LinearLayout>

<LinearLayout
    android:id="@+id/layout2"
    android:layout_alignParentBottom="true"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:orientation="horizontal">
    <!--some stuff here-->
</LinearLayout>
</RelativeLayout>
Run Code Online (Sandbox Code Playgroud)

在上面的代码时,键盘秀,我想layout2留在bottomlayout1go up with keyboard.如果我添加android:windowSoftInputMode="adjustPan|adjustResize"两个布局保持在底部.请帮忙

android android-layout android-softkeyboard android-xml android-studio

6
推荐指数
1
解决办法
2666
查看次数