I am using Layout_Weight to set the width of my buttons to 40% of my screen width. Works great! But now I can't really do much with the height.
Ideally I'd like to set a percentage for the height as well, but to my knowledge I can only set the layout_width percentage to one dimension.
To adjust the height of my buttons so they don't look like little slivers on tablets, I tried using padding, tried using \n. The buttons with two lines of text are unequal to the single line text when switching to tablet, but are equal on phones.
What's the best way to adjust the height to be dynamic in this way like the width?
<LinearLayout
android:layout_width="match_parent"
android:layout_height="fill_parent">
<Button
android:layout_width="0dp"
android:layout_height="wrap_content"
android:text="This takes up two lines"
android:id="@+id/btnDoubleLineExample"
android:layout_weight="40"
android:paddingTop="80dp"
android:paddingBottom="80dp"
android:paddingLeft="5dp"
android:paddingRight="5dp"
android:textSize="20sp"
/>
<Button
android:layout_width="0dp"
android:layout_height="wrap_content"
android:text="One Line\n"
android:id="@+id/btnOneLine"
android:layout_weight="40"
android:paddingTop="80dp"
android:paddingBottom="80dp"
android:paddingLeft="5dp"
android:paddingRight="5dp"
android:textSize="20sp"/>
</LinearLayout>
Thank you for your time.