use tabhost by extending MapActivity

前端 未结 2 1387
生来不讨喜
生来不讨喜 2021-01-25 21:39

main.xml



        
相关标签:
2条回答
  • 2021-01-25 22:36

    You need to use TabWidget : http://developer.android.com/reference/android/widget/TabWidget.html or http://developer.android.com/guide/tutorials/views/hello-tabwidget.html to show the buttons for the tabs if that's what you are looking for...

    0 讨论(0)
  • 2021-01-25 22:42

    i answer my question: tabWidget is wrong and add LinearLayout:

    <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">
    
        <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"  >
            <LinearLayout android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="wrap_content" android:id="@+id/main">
                <ListView android:id="@+id/list" android:layout_width="fill_parent" android:layout_height="0dip" android:layout_weight="1"/>
                <TextView android:id="@+id/empty" android:layout_width="wrap_content" android:layout_height="wrap_content" android:gravity="center" android:text="Loading"/>
    
            </LinearLayout>
            <RelativeLayout  android:id="@+id/mainlayout" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="wrap_content">
                <com.google.android.maps.MapView android:id="@+id/mapview" android:layout_width="fill_parent" android:layout_height="fill_parent" android:clickable="true" android:apiKey="0Ua9BENcUvNKEom7wvjrrtlCVIeJ9SNYAbLAkJA"/>
            </RelativeLayout>
          </FrameLayout>
      </LinearLayout>
    

    0 讨论(0)
提交回复
热议问题