I want my app to be able to scroll horizontally so it can slide between pages. But when I use this feature on android sdk it won't let me make the xml layout fill parent i.e. it won't let me have a full screen to include my buttons and objects.
Any idea on how can I fix this or what is an alternate method?
Here's the code:
<?xml version="1.0" encoding="utf-8"?>
<HorizontalScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
<RelativeLayout
android:layout_width="348dp"
android:layout_height="559dp" >
<ImageButton
android:id="@+id/imageButton1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"
android:layout_marginBottom="341dp"
android:layout_marginLeft="146dp"
android:src="@drawable/ic_launcher" />
</RelativeLayout>
</HorizontalScrollView>
Change the relative layout to LinearLayout. Similar to a vertical ScrollView, it makes use of a LinearLayout.
Here is a sample layout I have in one of my projects: