1. Download our Official Android App: Forums for Android!

Apps Help - Tab Host and Image button in a single line.

Discussion in 'Android Development' started by Vinodkumar, Jun 17, 2011.

  1. Vinodkumar

    Vinodkumar Lurker
    Thread Starter
    Rank:
    None
    Points:
    5
    Posts:
    2
    Joined:
    Jun 17, 2011

    Jun 17, 2011
    2
    0
    5
    Dear All,
    Any help for my query?

    1. To create Tab along with IMAGE BUTTON in single Line.
    2. ONLY TAB is Horizontally Scrollable but image button is fixed at the right extreme.

    TAB | TAB | TAB | TAB | TAB | (+)
    ------Scrollable --------- --Fixed

    <?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:fadingEdge="horizontal">



    <LinearLayout
    android:eek:rientation="vertical"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:padding="5dp">


    <HorizontalScrollView android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:fillViewport="true"
    android:scrollbars="none">

    <TabWidget
    android:id="@android:id/tabs"
    android:layout_width="200px"
    android:layout_height="wrap_content"
    android:tag="tabPane">
    </TabWidget>



    </HorizontalScrollView>

    <RelativeLayout
    android:eek:rientation="vertical"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content">
    <EditText
    android:id="@+id/address_bar"
    android:layout_alignParentLeft="true"
    android:layout_alignParentTop="true"
    android:layout_marginTop="10px"
    android:layout_width="420px"
    android:layout_height="70px"/>

    <ImageButton android:background="@android:color/transparent"
    android:layout_marginTop="10px"
    android:id="@+id/add_btn"
    android:layout_height="50px"
    android:layout_width="50px"
    android:src="@android:drawable/ic_menu_add"
    android:layout_toRightOf="@id/address_bar">
    </ImageButton>

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

    </TabHost>




    Best Regards
    Vinod
     

    Attached Files:


    Advertisement

  2. AndroidSPCS

    AndroidSPCS Android Expert
    Rank:
    None
    Points:
    183
    Posts:
    3,222
    Joined:
    Nov 12, 2009

    Nov 12, 2009
    3,222
    478
    183
    geek
    USA
    Welcome to AF.com! Moving this to Android Development.
     

Share This Page

Loading...