java - Elements in layout cropped -


i have problem layout file, when test on devices android 4.1, why happens don't know, here's get:

enter image description here

and here's part of layout happens:

<linearlayout             android:id="@+id/choosetype"             android:layout_width="match_parent"             android:layout_height="wrap_content"             android:visibility="visible"             android:layout_marginleft="16dp"             android:layout_marginstart="16dp"             android:layout_marginright="16dp"             android:layout_marginend="16dp"             android:layout_margintop="12dp"             android:orientation="horizontal">               <checkbox                 android:id="@+id/checkbox1"                 android:layout_width="wrap_content"                 android:layout_height="wrap_content"                 android:layout_weight="1"                 android:button="@drawable/custom_checkbox" />              <checkbox                 android:id="@+id/checkbox2"                 android:layout_width="wrap_content"                 android:layout_height="wrap_content"                 android:layout_weight="1"                 android:button="@drawable/custom_checkbox2" />              <checkbox                 android:id="@+id/checkbox3"                 android:layout_width="wrap_content"                 android:layout_height="wrap_content"                 android:layout_weight="1"                 android:button="@drawable/custom_checkbox3" />              <checkbox                 android:id="@+id/checkboxhomes"                 android:layout_width="wrap_content"                 android:layout_height="wrap_content"                 android:layout_weight="1"                 android:button="@drawable/custom_checkboxhouses" />              <checkbox                 android:id="@+id/checkboxrooms"                 android:layout_width="wrap_content"                 android:layout_height="wrap_content"                 android:button="@drawable/custom_checkboxrooms" />          </linearlayout> 

i've tried remove layout weight seems somehow linearlayout ignores , tries crop last element in layout.

first, if use linearlayout's weights, children set weight should have android:layout_width="0dp" (or android:layout_width when linearlayout's orientation vertical).

here have explanation.

second case did not set weight last of checkboxes :)


Comments

Popular posts from this blog

php - failed to open stream: HTTP request failed! HTTP/1.0 400 Bad Request -

java - How to filter a backspace keyboard input -

java - Show Soft Keyboard when EditText Appears -