软键盘上移一个布局但保持底部一个布局

5
我有以下的TabHost布局:
<?xml version="1.0" encoding="iso-8859-1"?>
<TabHost xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@android:id/tabhost"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:layout_margin="0dp"
    android:padding="0dp" >

    <LinearLayout
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:layout_margin="0dp"
        android:background="@drawable/main_app_background"
        android:orientation="vertical"
        android:padding="0dp" >

        <ImageView
            android:id="@+id/logo"
            android:layout_width="fill_parent"
            android:layout_height="@dimen/site_logo_height"
            android:layout_margin="0dp"
            android:background="@color/tab_subtitle_background"
            android:padding="0dp"
            android:src="@drawable/barlogo" />

        <FrameLayout
            android:id="@+id/tab_subtitle"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:layout_margin="0dp"
            android:gravity="center"
            android:padding="0dp" />

        <FrameLayout
            android:id="@android:id/tabcontent"
            android:layout_width="fill_parent"
            android:layout_height="fill_parent"
            android:layout_gravity="center"
            android:layout_margin="0dp"
            android:layout_weight="99"
            android:padding="0dp" />

        <Button
            android:id="@+id/btn_save"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginRight="15dp"
            android:layout_marginTop="7dp"
            android:focusableInTouchMode="true"
            android:imeOptions="actionNext"
            android:tag="done"
            android:text="Ok" />

        <TabWidget
            android:id="@android:id/tabs"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:layout_margin="0dp"
            android:layout_weight="1"
            android:padding="0dp" />
    </LinearLayout>

</TabHost>

事实上,当软键盘出现时,按钮和选项卡小部件都会向上移动。
我的目标是保持选项卡小部件在底部(软键盘下方),并让确定按钮向上移动(移到键盘顶部)。这种方式可行吗?
提前感谢!
2个回答

1

我已经在使用android:windowSoftInputMode="adjustResize"。但是我想要的是,当软键盘弹出时,保持TabWidget在键盘下方固定在底部,并且按钮随着键盘移动(像现在一样,使用ajustResize)。 - josetapadas

0
在你的清单文件中尝试这个:
<activity
    android:windowSoftInputMode="adjustPan"              
    android:name=".MainActivity" android:label="@string/app_name" >

无法工作。"keyboardHidden"是android:configChanges的一个值,而不是windowSoftInputMode。 - josetapadas

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接