2011-12-07 146 views
1

嘿人们在那里..底部带有mapview的标签顶部

我正在制作一个tabview应用程序,其中一个选项卡是mapview嵌入到。 Buut我想让tabview处于底部而不是顶部,当我将gravity或layout_marginBottom设置为true时,它会消失,并且不再显示在屏幕上。

下面是标签观活动

<?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:layout_width="fill_parent" 
    android:layout_height="fill_parent" 
    android:orientation="vertical" > 

     <TabWidget 
     android:id="@android:id/tabs" 
     android:layout_width="fill_parent" 
     android:layout_height="wrap_content" /> 

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

      <RelativeLayout 
      android:id="@+id/emptylayout1" 
      android:layout_width="fill_parent" 
      android:layout_height="fill_parent" 
      android:orientation="vertical" /> 

     </FrameLayout> 
    </LinearLayout> 

</TabHost> 

任何想法如何让选项卡下,仍然可见xml文件?

回答

3
<?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" 
    android:background="@android:color/white"> 

    <RelativeLayout 
     android:layout_width="fill_parent" 
     android:layout_height="fill_parent" > 

     <FrameLayout 
      android:id="@android:id/tabcontent" 
      android:layout_width="fill_parent" 
      android:layout_height="fill_parent" 
      android:padding="5dp" /> 

     <TabWidget 
      android:id="@android:id/tabs" 
      android:layout_width="fill_parent" 
      android:layout_height="wrap_content" 
      android:layout_alignParentBottom="true" /> 
    </RelativeLayout> 

</TabHost> 

这适用于我。将TabContent FrameLayout放置在TabWidget上方。请尝试一下,让我知道。

+0

你是一个geniiiiuuus ..:d非常感谢,真的是工作,但我有一个问题,在地图犯规充满整个屏幕,它是像有白色的边缘?无论如何要解决这个问题?? – Mustii1989

+0

** android:background =“@ android:color/white”**可能是白色边缘的原因。也可以尝试从FrameLayout中删除** android:padding =“5dp”**。 – Ian

+0

谢谢,解决了这个问题..它与填充工作,没有更长的边缘..非常感谢它非常帮助我:D – Mustii1989

1

我已经做了这样的...

<?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="match_parent" 
    android:layout_height="match_parent" > 

    <RelativeLayout 
     android:layout_width="match_parent" 
     android:layout_height="match_parent" 
     android:orientation="vertical" > 

     <FrameLayout 
      android:id="@android:id/tabcontent" 
      android:layout_width="match_parent" 
      android:layout_height="match_parent" 
      android:layout_above="@android:id/tabs" /> 

     <TabWidget 
      android:id="@android:id/tabs" 
      android:layout_width="match_parent" 
      android:layout_height="wrap_content" 
      android:layout_alignParentBottom="true" /> 
    </RelativeLayout> 

</TabHost> 
相关问题