i need a vertical ScrollView which contains 4 Buttons. Each Button should be of the Size of the Phone.
Something like this:
<ScrollView
android:id="@+id/scroll_view"
android:layout_width="fill_parent"
android:layout_height="wrap_content">
<LinearLayout
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">
<Button
android:layout_width="fill_parent"
android:layout_height="match_parent"
android:text="First Content."
android:textSize="50sp"/>
<Button
android:layout_width="fill_parent"
android:layout_height="match_parent"
android:text="Second Content."
android:textSize="50dip"/>
</LinearLayout>
</ScrollView>
I tried a lot of options but dont get how to manage this.
All you have to do a dynamic layout
keep a layout in your xml
and then in your activity/fragment java file
Calculate height of your device
Now Inflate and add Buttons to your layout container