1. Check out our companion app, Forums for Android! Download from Google Play

Layout Help!!

Discussion in 'Application Development' started by Adamsklan, Aug 17, 2010.

  1. Adamsklan

    Adamsklan New Member
    Thread Starter
    5

    Aug 17, 2010
    2
    0
    5
    Hey all! I'm new to the android world but not new to java at all. I basically am having atough time getting my head around the layouts though.

    I basically followed List View | Android Developers
    that tutorial to create a list of data.. Now I would like to add that list of data to an existing tab which I have created using Tab Layout | Android Developers that tutorial.

    I can't seem to figure out how to add my DataListView class to my DataViewTab class. In java layouts i would just create a box layout for DataViewTab and add the DataViewList class object to the BoxLayout...

    Thanks!
     

    Advertisement

  2. blundell

    blundell Well-Known Member
    38

    Apr 23, 2010
    125
    17
    38
    Software Engineer
    UK
    Whats up with ya?

    Code (Text):
    1.  
    2. <?xml version="1.0" encoding="utf-8"?>
    3. <TabHost
    4.         xmlns:android="http://schemas.android.com/apk/res/android"
    5.         xmlns:app="http://schemas.android.com/apk/res/com.blundell.fpsdoug.free"
    6.     android:id="@android:id/tabhost"
    7.     android:layout_width="fill_parent"
    8.     android:layout_height="fill_parent">
    9.         <TabWidget
    10.         android:id="@android:id/tabs"
    11.         android:layout_width="fill_parent"
    12.         android:layout_height="wrap_content"
    13.         />
    14.         <FrameLayout
    15.          android:id="@android:id/tabcontent"
    16.          android:layout_height="fill_parent"
    17.          android:layout_width="fill_parent">
    18.                  <LinearLayout
    19.                                 android:id="@+id/linearlayoutTab1"
    20.                                 android:layout_width="fill_parent"
    21.                                 android:layout_height="wrap_content"
    22.                                 android:orientation="vertical"
    23.                                 >
    24.                                 <ListView
    25.                                     android:id="@+id/listView"
    26.                                     android:layout_width="fill_parent"
    27.                                     android:layout_height="wrap_content"
    28.                                     android:entries="@array/blah"
    29.                                   />
    30.                 </LinearLayout>
    31.                 <LinearLayout
    32.                                 android:id="@+id/linearlayoutTab2"
    33.                                 android:layout_width="fill_parent"
    34.                                 android:layout_height="wrap_content"
    35.                                 android:orientation="vertical"
    36.                                 >
    37.                 </LinearLayout>
    38.         </FrameLayout>
    39. </TabHost>
    40.  
     
  3. Adamsklan

    Adamsklan New Member
    Thread Starter
    5

    Aug 17, 2010
    2
    0
    5
    Well that worked to the point where I can see my list, but the list is being overlayed on top of the tab layout so I cant click any tabs, i can only select list items... Should there be any specific code in the class for the tab which I want to display the list?
     

Share This Page

Loading...