为何键盘出现在TabBar之后?

时间:2012-01-31 09:02:26

标签: android android-layout android-intent tabbar tabwidget

在我的应用程序中有tabBar和Edittext。

见下图:

正常屏幕:

enter image description here

和图像按下edittext后:

enter image description here

现在为什么这个标签栏会出现在键盘上。 即使用户按下edittext打开键盘,我希望它仍然保持在底部。

那我该怎么办呢?

请帮帮忙吗?

TabBarMain活动的我的xml布局如下所示:

    <?xml version="1.0" encoding="utf-8"?>
<TabHost xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@android:id/tabhost"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    >

    <LinearLayout
        android:id="@+id/LL1"
        android:orientation="vertical"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        >

       <FrameLayout
            android:id="@android:id/tabcontent"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            />

      <TabWidget
            android:id="@android:id/tabs"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content" 
            android:layout_gravity="bottom"
            android:layout_weight="0"/>

    </LinearLayout>

</TabHost> 

所以请帮助我。

感谢。

3 个答案:

答案 0 :(得分:13)

请使用此

android:windowSoftInputMode="adjustPan"

在活动中的android menifest.xml文件中。

实施例..

<activity
            android:name="Youractivity"
            android:windowSoftInputMode="adjustPan"/>

答案 1 :(得分:2)

在TabHost中设置以下内容

android:isScrollContainer="false"

答案 2 :(得分:1)

在清单文件的活动属性windowsoftinputmode中添加stateUnchanged,如下所示:

 <activity android:name="Youractivity"
        android:windowSoftInputMode="stateUnchanged"/>
相关问题