0

This is my first question on stackoverflow and I tried to make some of the given answers work but failed.. So, without much adieu, here goes.. :>

I'm trying to make a section of an app about a saint telling his life story in a sequence of images and short text lines detailing the images - a sort of image slide show with text.

What I'm trying to do is an ImageView on top with a Textview at the bottom with the image filling the available screen size. On a user horizontal swipe, the next Image-Text slide loads up different content - replacing the previous content - Imageview filling the screensize completely again.

Basically, a Gallery-esque horizontal swipe/scroll implementation plus the textview (minus the gridview, the pinch-zoom functionality)

I'm a noobie with Java and I tried doing this in XML with HorizontalScrollView but the Imageview doesn't fill the total available screensize or exceeds the screensize making it very non-user-friendly. In Landscape, the textview is hidden completely and even after using weight in LinearLayout, I couldn't make them visible. :S

EDIT:

Current XML Layout

<HorizontalScrollView xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/horizontalScrollView1"
    android:layout_width="match_parent"
    android:layout_height="match_parent" >

    <LinearLayout
        android:layout_width="wrap_content"
        android:layout_height="match_parent" >

        <RelativeLayout
            android:layout_width="wrap_content"
            android:layout_height="match_parent" >

            <ImageView
                android:id="@+id/imageView1"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:src="@drawable/dbyouth000" />
        </RelativeLayout>

        <RelativeLayout
            android:layout_width="wrap_content"
            android:layout_height="match_parent" >

            <TextView
                android:id="@+id/textView1"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:drawableTop="@drawable/dbyouth001"
                android:text="@string/dbystring001"
                android:textAppearance="?android:attr/textAppearanceMedium" />
        </RelativeLayout>

        <RelativeLayout
            android:layout_width="wrap_content"
            android:layout_height="match_parent" >

            <ImageView
                android:id="@+id/imageView3"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:src="@drawable/dbyouth001b" />

            <TextView
                android:id="@+id/textView2"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_below="@id/imageView3"
                android:text="@string/dbystring001b"
                android:textAppearance="?android:attr/textAppearanceMedium" />
        </RelativeLayout>
    </LinearLayout>

</HorizontalScrollView>

Potrait Screenshots:

Postimg Gallery 1

Landscape Screenshots:

Postimg Gallery 2

  • Thanks for reading and I would really appreciate any help :>
N00B1E
  • 1
  • 1
  • 2
  • You might give links to the posts you tried and why they didn't work for you. You'll also want to provide your layout and handling code. – ChiefTwoPencils Aug 08 '14 at 03:58
  • I used the link on [this answer](http://stackoverflow.com/questions/17965420/how-to-place-a-textview-on-gallery-in-android) and [this answer](http://stackoverflow.com/questions/10299713/gallery-on-image-change-textview-update) and [this answer](http://stackoverflow.com/questions/8284862/android-gallery-using-textview-and-imageview-doesnt-work) but got more confused as the requirements seem to be different. The search terms I'm using are "gallery","textview". What other terms do you think I should use? – N00B1E Aug 12 '14 at 03:50
  • I'd say you're going about it the wrong way. Consider making a layout for the view that contains the image and the text. Make another layout that is made up of a ViewFlipper. Grab the view flipper by id, then loop inflating the views with the image and text, adding them to the flipper. Also, if you search using terms that don't *really* do what you want (gallery) it will be hard to find help. – ChiefTwoPencils Aug 12 '14 at 05:05

0 Answers0