Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

android horizontal scrollview

Tags:

android

Hi am testing horizontal scrollview i came to a strange problem ,i put one button in horizontal scrollview with layout height and width fill_parent but that tag have no effect in layout ,lets look in to my layout

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

    <LinearLayout
        android:id="@+id/linearLayout1"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"

        >
        <Button             
            android:text="Button"
            android:id="@+id/button1"
            android:layout_width="fill_parent"
            android:layout_height="fill_parent">
        </Button>
    </LinearLayout>

    </HorizontalScrollView>

How can i fill the layout with my button inside horizontal scrollview

like image 728
Bytecode Avatar asked Feb 14 '11 04:02

Bytecode


1 Answers

the problem might be in android:width="wrap_content"....
as u did wrap content for horizontal scrollview and it is parent of linearlayout and button in above case.......
that might be creating all the problem... either hard code size of linear layout or put android:width="fill_parent" in horizontal scroll view.....

like image 97
N-JOY Avatar answered Oct 03 '22 12:10

N-JOY