I need to have a arrayAdapter (fragment) inside a scroll view with buttons underneath, Unfortunately, when doing that my fragment have the size of one element and is scrolling himself
here is my view:
<ScrollView
android:id="@+id/scrollView1"
android:layout_width="match_parent"
android:layout_height="fill_parent" >
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<fragment
android:id="@+id/myfragment"
android:name="com.myapply.MyListFragment"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="clip_vertical" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="TEST TEST TEST"
android:textColor="#FFFFFF"
android:textSize="25dp" />
</LinearLayout>
</ScrollView>
any help will be welcome
Short answer is that you cannot have a ListView inside a ScrollView. Here is a related SO thread.
Looking at your layout you could redesign it to a RelativeLayout:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<fragment
android:id="@+id/myfragment"
android:name="com.myapply.MyListFragment"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="clip_vertical"
android:layout_above="@+id/bottomTextView" />
<TextView
android:id="@+id/bottomTextView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="TEST TEST TEST"
android:textColor="#FFFFFF"
android:layout_alignParentBottom="true"
android:textSize="25dp" />
</RelativeLayout>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With