
Untitled
By: a guest on
May 12th, 2012 | syntax:
None | size: 1.17 KB | hits: 25 | expires: Never
Is there a hard limit on the minimum height of a button in Android?
int screenWidth = getWindowManager().getDefaultDisplay().getWidth();
int buttonWidth = (screenWidth*2)/3;
int screenHeight = getWindowManager().getDefaultDisplay().getHeight();
int buttonHeight = (screenHeight-60)/14;
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_height="fill_parent"
android:layout_width="fill_parent"
android:orientation="vertical">
<LinearLayout android:layout_height="wrap_content"
android:layout_width="fill_parent"
android:orientation="horizontal">
<View android:layout_height="wrap_content"
android:layout_width="fill_parent"
android:layout_weight="2"/>
<Button android:layout_height="wrap_content"
android:layout_width="fill_parent"
android:layout_weight="1"
android:text="Button"
android:id="@+id/button"/>
<View android:layout_height="wrap_content"
android:layout_width="fill_parent"
android:layout_weight="2"/>
</LinearLayout>
</LinearLayout>