0

In my xml layout I have 2 separate layouts in the same file, a grid of pictures and then a full screen image view. The issue is that the grid of pictures scrolls down to the bottom but not all the way to the top, the pictures are cut off. I am not sure why this would happen, here is my xml file:

<LinearLayout
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical"
    android:background="#000">

<LinearLayout
        android:layout_width="fill_parent"
        android:orientation="vertical"
        android:layout_height="fill_parent"
        android:id="@+id/full_image"
        android:visibility="gone"
        android:background="#00000000">

    <Button
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="Return"
            android:id="@+id/button1"
            android:background="#fff"
            android:layout_marginTop="5dp"
            android:layout_marginLeft="5dp"
            android:layout_marginBottom="0dp"
            android:layout_gravity="left|center_vertical"/>

    <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:id="@+id/TitleText3"
            android:textStyle="bold"
            android:layout_gravity="center"
            android:textColor="#fff"
            android:textIsSelectable="false"
            android:layout_marginBottom="-50dp"
            />

    <ImageView
            android:id="@+id/full_image_view"
            android:layout_width="fill_parent"
            android:layout_height="450dp"
            android:clickable="true"
            android:background="#00000000"
            android:layout_marginBottom="35dp"/>

    <SeekBar
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:id="@+id/seekBar"
            android:layout_gravity="left|center_vertical"
            android:layout_marginTop="-110dp"
            android:max="26"
            android:longClickable="false"/>
</LinearLayout>

<ScrollView

        android:orientation="vertical"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:layout_gravity="left|center_vertical"
        android:id="@+id/rows">



<LinearLayout
        android:orientation="vertical"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:layout_gravity="left|center_vertical"
        >


    <LinearLayout
            android:orientation="horizontal"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="left|center_vertical"
            android:weightSum="0"
            android:id="@+id/row1"
            android:layout_marginTop="5dp">
        <ImageView
                android:id="@+id/image1"
                android:layout_width="100dp"
                android:layout_height="75dp"
                android:layout_weight="20"
                android:clickable="true"
                android:background="@drawable/plane1"/>
        <ImageView
                android:id="@+id/image2"
                android:layout_width="100dp"
                android:layout_height="75dp"
                android:layout_weight="20"
                android:background="@drawable/plane2"
                android:clickable="true"
                android:layout_marginLeft="5dp"/>
        <ImageView
                android:id="@+id/image3"
                android:layout_width="100dp"
                android:layout_height="75dp"
                android:background="@drawable/plane3"
                android:clickable="true"
                android:layout_marginLeft="5dp"
                android:layout_weight="20"/>
        <ImageView
                android:id="@+id/image4"
                android:layout_width="100dp"
                android:layout_height="75dp"
                android:layout_weight="20"
                android:background="@drawable/plane4"
                android:clickable="true"
                android:layout_marginLeft="5dp"
                android:adjustViewBounds="true"/>
    </LinearLayout>
    <LinearLayout

            android:orientation="horizontal"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginTop="5dp"
            android:id="@+id/row2">
        <ImageView
                android:id="@+id/image5"
                android:layout_width="100dp"
                android:layout_height="75dp"
                android:layout_weight="20"
                android:clickable="true"
                android:background="@drawable/plane5"/>
        <ImageView
                android:id="@+id/image6"
                android:layout_width="100dp"
                android:layout_height="75dp"
                android:layout_weight="20"
                android:background="@drawable/plane6"
                android:clickable="true"
                android:layout_marginLeft="5dp"/>

        <ImageView
                android:id="@+id/image7"
                android:layout_width="100dp"
                android:layout_height="75dp"
                android:background="@drawable/plane7"
                android:clickable="true"
                android:layout_marginLeft="5dp"
                android:layout_weight="20"/>
        <ImageView
                android:id="@+id/image8"
                android:layout_width="100dp"
                android:layout_height="75dp"
                android:layout_weight="20"
                android:background="@drawable/plane8"
                android:clickable="true"
                android:layout_marginLeft="5dp"/>

    </LinearLayout>
    <LinearLayout
            android:orientation="horizontal"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginTop="5dp"
            android:id="@+id/row3">

        <ImageView
                android:id="@+id/image9"
                android:layout_width="100dp"
                android:layout_height="75dp"
                android:layout_weight="20"
                android:clickable="true"
                android:background="@drawable/plane9"/>
        <ImageView
                android:id="@+id/image10"
                android:layout_width="100dp"
                android:layout_height="75dp"
                android:layout_weight="20"
                android:background="@drawable/plane10"
                android:clickable="true"
                android:layout_marginLeft="5dp"/>
        <ImageView
                android:id="@+id/image11"
                android:layout_width="100dp"
                android:layout_height="75dp"
                android:background="@drawable/plane11"
                android:clickable="true"
                android:layout_marginLeft="5dp"
                android:layout_weight="20"/>
        <ImageView
                android:id="@+id/image12"
                android:layout_width="100dp"
                android:layout_height="75dp"
                android:layout_weight="20"
                android:background="@drawable/plane12"
                android:clickable="true"
                android:layout_marginLeft="5dp"/>
    </LinearLayout>

    <LinearLayout
            android:orientation="horizontal"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginTop="5dp"
            android:id="@+id/row4">

        <ImageView
                android:id="@+id/image13"
                android:layout_width="100dp"
                android:layout_height="75dp"
                android:layout_weight="20"
                android:clickable="true"
                android:background="@drawable/plane13"/>
        <ImageView
                android:id="@+id/image14"
                android:layout_width="100dp"
                android:layout_height="75dp"
                android:layout_weight="20"
                android:background="@drawable/plane14"
                android:clickable="true"
                android:layout_marginLeft="5dp"/>
        <ImageView
                android:id="@+id/image15"
                android:layout_width="100dp"
                android:layout_height="75dp"
                android:background="@drawable/plane15"
                android:clickable="true"
                android:layout_marginLeft="5dp"
                android:layout_weight="20"/>
        <ImageView
                android:id="@+id/image16"
                android:layout_width="100dp"
                android:layout_height="75dp"
                android:layout_weight="20"
                android:background="@drawable/plane16"
                android:clickable="true"
                android:layout_marginLeft="5dp"/>
    </LinearLayout>
    <LinearLayout
            android:orientation="horizontal"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginTop="5dp"
            android:id="@+id/row5">

        <ImageView
                android:id="@+id/image17"
                android:layout_width="100dp"
                android:layout_height="75dp"
                android:layout_weight="20"
                android:clickable="true"
                android:background="@drawable/plane17"/>
        <ImageView
                android:id="@+id/image18"
                android:layout_width="100dp"
                android:layout_height="75dp"
                android:layout_weight="20"
                android:background="@drawable/plane18"
                android:clickable="true"
                android:layout_marginLeft="5dp"/>
        <ImageView
                android:id="@+id/image19"
                android:layout_width="100dp"
                android:layout_height="75dp"
                android:background="@drawable/plane19"
                android:clickable="true"
                android:layout_marginLeft="5dp"
                android:layout_weight="20"/>
        <ImageView
                android:id="@+id/image20"
                android:layout_width="100dp"
                android:layout_height="75dp"
                android:layout_weight="20"
                android:clickable="true"
                android:layout_marginLeft="5dp"
                android:background="@drawable/plane20"/>
    </LinearLayout>
    <LinearLayout
            android:orientation="horizontal"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginTop="5dp"
            android:id="@+id/row6">

        <ImageView
                android:id="@+id/image21"
                android:layout_width="100dp"
                android:layout_height="75dp"
                android:layout_weight="20"
                android:clickable="true"
                android:background="@drawable/plane21"/>
        <ImageView
                android:id="@+id/image22"
                android:layout_width="100dp"
                android:layout_height="75dp"
                android:layout_weight="20"
                android:background="@drawable/plane22"
                android:clickable="true"
                android:layout_marginLeft="5dp"/>
        <ImageView
                android:id="@+id/image23"
                android:layout_width="100dp"
                android:layout_height="75dp"
                android:background="@drawable/plane23"
                android:clickable="true"
                android:layout_marginLeft="5dp"
                android:layout_weight="20"/>
        <ImageView
                android:id="@+id/image24"
                android:layout_width="100dp"
                android:layout_height="75dp"
                android:layout_weight="20"
                android:clickable="true"
                android:layout_marginLeft="5dp"
                android:background="@drawable/plane24"/>
    </LinearLayout>
    <LinearLayout
            android:orientation="horizontal"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginTop="5dp"
            android:id="@+id/row8">

        <ImageView
                android:id="@+id/image25"
                android:layout_width="100dp"
                android:layout_height="75dp"
                android:layout_weight="20"
                android:clickable="true"
                android:background="@drawable/plane25"/>
        <ImageView
                android:id="@+id/image26"
                android:layout_width="100dp"
                android:layout_height="75dp"
                android:layout_weight="20"
                android:background="@drawable/plane26"
                android:clickable="true"
                android:layout_marginLeft="5dp"/>
        <ImageView

                android:layout_width="100dp"
                android:layout_height="75dp"
                android:layout_weight="20"
                android:clickable="true"
                android:layout_marginLeft="5dp"/>
        <ImageView

                android:layout_width="100dp"
                android:layout_height="75dp"
                android:layout_weight="20"
                android:clickable="true"
                android:layout_marginLeft="5dp"/>
    </LinearLayout>
    <LinearLayout
            android:orientation="horizontal"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginTop="5dp"
            android:id="@+id/row8">

        <ImageView
                android:id="@+id/image27"
                android:layout_width="100dp"
                android:layout_height="75dp"
                android:layout_weight="20"
                android:clickable="true"
                android:background="@drawable/plane25"/>
        <ImageView
                android:id="@+id/image28"
                android:layout_width="100dp"
                android:layout_height="75dp"
                android:layout_weight="20"
                android:background="@drawable/plane26"
                android:clickable="true"
                android:layout_marginLeft="5dp"/>
        <ImageView

                android:layout_width="100dp"
                android:layout_height="75dp"
                android:layout_weight="20"
                android:clickable="true"
                android:layout_marginLeft="5dp"/>
        <ImageView

                android:layout_width="100dp"
                android:layout_height="75dp"
                android:layout_weight="20"
                android:clickable="true"
                android:layout_marginLeft="5dp"/>
    </LinearLayout>
</LinearLayout>
</ScrollView>

1
  • you use fill_parent for the scrollview dimensions. is there a specific reason for that? I tend to use match_parent or wrap_content and I don't have that problem. Commented Jul 25, 2013 at 18:44

1 Answer 1

1

You seem to be missing a LinearLayout tag at the end.

You start the file with a parent LinearLayout declaration, and never have an ending </LinearLayout> tag to match it.

Try adding </LinearLayout> to the very end, right after </ScrollView>.

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

3 Comments

I checked my layout and it was there, it must not have copied over when i put the code on here. wouldn't the intelij tell me that was the error if that was?
Try changing your ScrollView's width and height to wrap_content. Also do the same for the first LinearLayout within your ScrollView.
Have you considered creating a new layout with just the parent LinearLayout and begin adding in sections (or blocks) of the current layout in, to see what works, and then when it stops working?

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.