2010-06-14 89 views
3

我在底部設置了我的tabWidget。當我想編輯編輯文本時,鍵盤會升起。但標籤小部件來自鍵盤上方。爲了支持多屏幕,我設置了android:layout_weight =「1.0」。之後,我遇到了這個問題,我在下面添加了我的佈局代碼。任何想法使TabWidget在底部穩定?TabWidget在Android的底部不穩定?爲什麼?

代碼:

<?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="fill_parent"> 
<LinearLayout android:orientation="vertical" 
    android:layout_width="fill_parent" android:layout_height="fill_parent"> 
    <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" 
     android:id="@android:id/tabcontent" android:layout_width="fill_parent" 
     android:layout_height="wrap_content" android:layout_weight="1.0"> 

    </FrameLayout> 
    <TabWidget android:id="@android:id/tabs" 
     android:layout_gravity="bottom" android:background="@drawable/gradient_black" 
     android:listSelector="@color/transparent" android:layout_width="fill_parent" 
     android:layout_height="63dip" /> 
</LinearLayout> 

+0

[看這裏](http://stackoverflow.com/a/6992662/593709)如果你想iPhone像標籤主機。 – 2012-03-21 11:11:05

回答

4

您可能需要調整您的清單中windowSoftInputMode。這將控制顯示軟鍵盤時屏幕的移動方式。也許你想adjustPan而不是默認adjustResize?這page有各種輸入模式的更多信息。