2

I have problem with layout (buttons) in Andoid. What I want is to display buttons inside ScrollView but the ScrollView must be below a RelativeLayout or with other words, the first two buttons from the ScrollView are not displayed on my phone..

here is the picture: enter image description here

here is my layout:

    <RelativeLayout  android:layout_width="fill_parent" android:layout_height="wrap_content">
        <TextView android:textAppearance="?android:textAppearanceLarge" android:id="@+id/textView1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginTop="58.0dip" android:text="@string/naziv" android:layout_alignParentTop="true" android:layout_centerHorizontal="true" />
    </RelativeLayout>

    <ScrollView
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:id="@+id/scrollView" >

        <LinearLayout android:layout_gravity="center" android:orientation="vertical" android:paddingLeft="30.0dip" android:paddingTop="90.0dip" android:paddingRight="30.0dip"  android:paddingBottom="20dp" android:layout_width="fill_parent" android:layout_height="wrap_content">
            <Button android:id="@+id/button0"  android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="@string/gumb_veter"  />
            <Button android:id="@+id/button4"  android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="@string/gumb_plimovanje" />
            <Button android:id="@+id/button1"  android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="@string/gumb_trenutni_podatki" />
            <Button android:id="@+id/button5"  android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="@string/gumb_video" />
            <Button android:id="@+id/button2"  android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="@string/gumb_mbp" />
            <Button android:id="@+id/button10"  android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="@string/gumb_wsg"/>
            <Button android:id="@+id/button11"  android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="@string/gumb_ath" />
            <Button android:id="@+id/button12"  android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="@string/gumb_sts" />
            <Button android:id="@+id/button13"  android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="@string/gumb_w" />
            <Button android:id="@+id/button14"  android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="@string/gumb_dotb" />
            <Button android:id="@+id/button15"  android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="@string/gumb_ast" />
            <Button android:id="@+id/button16"  android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="@string/gumb_caw" />
            <Button android:id="@+id/button17"  android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="@string/gumb_pado" />


        </LinearLayout>
    </ScrollView>



</LinearLayout>

How to diplay a ScrollView below text "morska bioloska postaja..."?

thank you

2 Answers 2

3

You need to remove android:layout_gravity="center" from the LinearLayout inside the ScrollView. You might also want to remove its android:paddingTop="90.0dip".

Sign up to request clarification or add additional context in comments.

Comments

1

add this to your scrollview:

android:layout_below = "@id/textView1"

this should add the scroll below your textView, and remove this:

android:layout_height="fill_parent"

and replace by this:

android:layout_height="wrap_content"

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.