Advertisement
ncosentino

Tab Fragment Tutorial - Layouts - tabs_fragment.xml

Oct 30th, 2013
2,093
0
Never
1
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
XML 1.71 KB | None | 0 0
  1. <!--
  2. Blog Post:
  3. http://devleader.ca/2013/11/04/fragments-tabbed-android-user-interface
  4.  
  5. Layouts:
  6. activity_main.xml: http://pastebin.com/kj8M38Ze
  7. fragment_tabs.xml: http://pastebin.com/0b7HAeAK
  8. simple_tab.xml: http://pastebin.com/9SqLbS0X
  9.  
  10. Classes:
  11. MainActivity.java: http://pastebin.com/eBv3H775
  12. SimpleTabDefinition.java: http://pastebin.com/wW3WCcy9
  13. TabDefinition.java: http://pastebin.com/KSRV2f3U
  14. TabsFragment.java: http://pastebin.com/9Asv7AVH
  15. -->
  16. <TabHost
  17.    xmlns:android="http://schemas.android.com/apk/res/android"
  18.    android:id="@android:id/tabhost"
  19.    android:layout_width="fill_parent"
  20.    android:layout_height="fill_parent"
  21.    android:background="#EFEFEF">
  22.  
  23.     <LinearLayout
  24.        android:orientation="vertical"
  25.        android:layout_width="fill_parent"
  26.        android:layout_height="fill_parent">
  27.  
  28.         <TabWidget
  29.            android:id="@android:id/tabs"
  30.            android:layout_width="fill_parent"
  31.            android:layout_height="wrap_content" />
  32.  
  33.             <FrameLayout
  34.                android:id="@android:id/tabcontent"
  35.                android:layout_width="fill_parent"
  36.                android:layout_height="fill_parent">
  37.  
  38.                 <FrameLayout
  39.                    android:id="@+id/tab1"
  40.                    android:layout_width="fill_parent"
  41.                    android:layout_height="fill_parent"
  42.                    android:background="#FFFF00" />
  43.  
  44.                 <FrameLayout
  45.                    android:id="@+id/tab2"
  46.                    android:layout_width="fill_parent"
  47.                    android:layout_height="fill_parent"
  48.                    android:background="#FF00FF" />
  49.  
  50.             </FrameLayout>
  51.     </LinearLayout>
  52. </TabHost>
Advertisement
Comments
  • ncosentino
    272 days
    # text 0.18 KB | 0 0
    1. Remember to check out my blog: https://www.devleader.ca
    2. Subscribe to my newsletter at: https://www.devleader.ca/newsletter
    3. Check out my videos at: https://www.youtube.com/devleader
Add Comment
Please, Sign In to add comment
Advertisement