How do I make elements in a layout occupy 50, 25, 10, etc. percent of the horizontal/vertical space available?
You could achieve this with something like that : ( for vertical here )
<LinearLayout
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="0dip"
android:weightSum="100">
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="60">
</LinearLayout>
</LinearLayout>`
See android:weightsum documentation
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