如何使用软键盘强制视图底部的按钮向上移动?

时间:2015-10-07 21:49:44

标签: android android-layout android-softkeyboard

我的视图底部有一个按钮,我希望当我的editText与按钮保持在软键盘顶部时进行交互时。我怎么强迫这个?这是我的布局格式化的方式。另请注意,这是视图寻呼机内部的一个片段(如果这很重要)。

<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/fl_parent"
    android:layout_width="match_parent"
    android:layout_height="match_parent">

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        ... some code
    </LinearLayout>

    <!-- button at bottom -->
    <LinearLayout
        android:id="@+id/bottom_wrapper"
        android:layout_width="match_parent"
        android:layout_height="match_parent">

        <!-- next button -->
        <Button
            android:id="@+id/btn_next"
            android:layout_width="match_parent"
            android:layout_height="54dp"
            android:layout_gravity="bottom" />
    </LinearLayout>
</FrameLayout>

1 个答案:

答案 0 :(得分:2)

尝试在if(list contains All same strings) same = true else if(list contains atleast one different element) same = false 中为特定manifest.xml

添加此内容
Activity
清单中的

将如下所示: -

android:windowSoftInputMode="adjustResize"
相关问题