My question is simple. Is it possible to create tabs entirely in xml? My app has only one a开发者_StackOverflow社区ctivity. I want to have 2 tabs that show the same data but in slightly different layouts. It seems like it should be but I cannot find anything on it.
TIA,
Mark
You can do something like this. Your layout for each tab would go inside a tabwidget. This will have it's limitations that you would easily get around if you employ a simple TabHost
 <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">
    <!-- Tabs at bottom of screen -->
    <TabWidget
    android:background="@drawable/textview_top"
    android:layout_weight="12"
    android:id="@android:id/tabs"
    android:layout_width="fill_parent"
    android:layout_height="0dip"
    />
   </TabHost>
 
         
                                         
                                         
                                         
                                        ![Interactive visualization of a graph in python [closed]](https://www.devze.com/res/2023/04-10/09/92d32fe8c0d22fb96bd6f6e8b7d1f457.gif) 
                                         
                                         
                                         
                                         加载中,请稍侯......
 加载中,请稍侯......
      
精彩评论