Hello All,

I am trying to add a HorizontalScrollView to my layout with a left and right 
arrow image button on either side of the HorizontalScrollView. How can I 
specify the android:layout_xxx parameter so that I have the left arrow image 
button at the left, the right arrow image button at the right and the 
HorizontalScrollView in the middle of these image buttons.

I can achieve the above but only if I set the width of the 
HorizontalScrollView to be of fixed size. Can I achieve the above without 
having to specify width for the scroll view? 

If I set android:layout_centerInParent, then it will overlay on the 2 image 
buttons.
I want to avoid having to type width numbers and would prefer to use 
'wrap_content' or 'fill_parent'

Pls advice.

My XML code:

<FrameLayout
        android:id="@+id/frameLayout3"
        android:layout_width="fill_parent"
        android:layout_height="100px">
        <RelativeLayout
            android:id="@+id/relativeLayout2"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content">
        <ImageButton
            android:id="@+id/zoneLeftArrowButton"
            android:src="@drawable/arrow_left"
            android:background="@android:color/transparent"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_alignParentLeft="true">
        </ImageButton>
        <ImageButton
                android:id="@+id/zoneRightArrowButton"
                android:src="@drawable/arrow_right"
                android:background="@android:color/transparent"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_alignParentRight="true">
            </ImageButton>
        <HorizontalScrollView
            android:id="@+id/hsvZones"
            android:layout_width="650px"
            android:layout_height="fill_parent"
            android:fadingEdge="horizontal"
            android:fadingEdgeLength="25px"
            android:scrollbars="none"
            android:layout_toRightOf="@+id/zoneLeftArrowButton">
            <TableLayout
                android:id="@+id/zoneTableLayout"
                android:layout_width="fill_parent"
                android:layout_height="fill_parent"
                android:gravity="top|fill_horizontal">
            </TableLayout>
        </HorizontalScrollView>
        </RelativeLayout>
    </FrameLayout>

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to