I have an app which has a relative layout as the parent, a header and a footer, and textview as its content (where details are). I’d like to make the textview scrollable. Even though I added scrollview in my xml it’s not showing the scrollview.. Can you help me figure out what I’m missing here?
Kindly check my .xml:
<LinearLayout
android:id="@+id/l1"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:gravity="center_horizontal"
android:layout_alignParentTop="true">
<include layout="@layout/tabsfordiseases"/>
</LinearLayout>
<TextView
android:id="@+id/tvValvularDescription"
style="@style/DescriptionHeader"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentRight="true"
android:layout_below="@+id/l1"
android:layout_marginTop="28dp"
android:drawableLeft="@drawable/note16"
android:textStyle="bold" />
<LinearLayout
android:id="@+id/l2"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:gravity="center_horizontal" >
<include layout="@layout/zooming_controls" />
</LinearLayout>
<ScrollView
android:id="@+id/scrollView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_below="@+id/tvValvularDescription"
android:layout_marginLeft="25dp"
android:layout_marginTop="14dp" >
<!-- <LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal" > -->
<TextView
android:id="@+id/tvValvularDescriptionContainer"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="hello world" />
</ScrollView>
</RelativeLayout>
Your
TextViewwill become scrollable as soon as it exceeds the boundaries of yourScrollView, given that you wrapped it in one.Since you set the text to ‘Hello world’, I’m guessing the TextView simply doesn’t exceed the
ScrollView..?