Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on May 12th, 2012  |  syntax: None  |  size: 1.17 KB  |  hits: 25  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. Is there a hard limit on the minimum height of a button in Android?
  2. int screenWidth = getWindowManager().getDefaultDisplay().getWidth();
  3. int buttonWidth = (screenWidth*2)/3;
  4.        
  5. int screenHeight = getWindowManager().getDefaultDisplay().getHeight();
  6. int buttonHeight = (screenHeight-60)/14;
  7.        
  8. <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
  9.     android:layout_height="fill_parent"
  10.     android:layout_width="fill_parent"
  11.     android:orientation="vertical">
  12.     <LinearLayout android:layout_height="wrap_content"
  13.         android:layout_width="fill_parent"
  14.         android:orientation="horizontal">
  15.             <View android:layout_height="wrap_content"
  16.                 android:layout_width="fill_parent"
  17.                 android:layout_weight="2"/>
  18.             <Button android:layout_height="wrap_content"
  19.                 android:layout_width="fill_parent"
  20.                 android:layout_weight="1"
  21.                 android:text="Button"
  22.                 android:id="@+id/button"/>
  23.             <View android:layout_height="wrap_content"
  24.                 android:layout_width="fill_parent"
  25.                 android:layout_weight="2"/>
  26.     </LinearLayout>
  27. </LinearLayout>