I'm strugglingwith ScrollView, and don't really see what's wrong with it.
-My objective is to make a scrollable fragment with images and text(under each image). I've already added some simple images, and was trying to add a dedicated ScrollView for text under those images.
Problem explanation starts here: When the fragment has only 1 image and 1 ScrollView the ScrollView work fine, but when I add one more image below, ScrollView just freezes and doesn't scroll anymore. Where is my mistake?
Here is the code:
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:fillViewport="true">
<LinearLayout
android:id="@+id/LinearLayout_Parent"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<ImageView
android:id="@+id/top_image1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/image1"
android:adjustViewBounds="true"/>
<ScrollView
android:layout_width="wrap_content"
android:layout_height="100dp">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/rly_large"/>
</ScrollView>
//when ImageView is added ScrollView stops wotking
**<ImageView
android:id="@+id/top_image2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/image2"/>**
</LinearLayout>
Whitout ImageView inside ** everything works fine but when that ImageView is added the ScrollView stops scrolling.
I hope you could point for the mistake, and hope didn't made a stupid question.
Thank you very much.
Android Stuido: 2.1.2 JRE 1.8.0-b15