android - XML - Layout going over edge of screen when using weight=1 -


how can have bottom row of images not cut in half on smaller/medium screens?

<?xml version="1.0" encoding="utf-8"?> <linearlayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="match_parent" android:orientation="vertical"  android:background="@drawable/wood1" android:id="@+id/mainll" >   <linearlayout      android:id="@+id/linearad"      android:layout_width="fill_parent"      android:layout_height="wrap_content"      android:layout_gravity="center_horizontal"      android:background="@drawable/shade"      android:gravity="center_horizontal"      android:orientation="horizontal" >  </linearlayout>   <linearlayout      android:id="@+id/toprow"      android:layout_width="fill_parent"      android:layout_height="10dp"      android:layout_margintop="1dp"      android:layout_marginbottom="1dp"      android:layout_weight="1"      android:orientation="horizontal" >      <button         android:id="@+id/timeline"         android:layout_width="wrap_content"         android:layout_height="fill_parent"         android:layout_margin="2dp"         android:layout_weight="1"         android:background="@drawable/an1" /> </linearlayout>    <linearlayout     android:id="@+id/row1"     android:layout_width="fill_parent"     android:layout_height="wrap_content"     android:layout_weight="1"     android:orientation="horizontal"  >      <button         android:id="@+id/button1"         android:layout_width="wrap_content"         android:layout_height="fill_parent"         android:layout_margin="2dp"         android:layout_weight="1"         android:background="@drawable/an1" />      <button         android:id="@+id/button2"         android:layout_width="wrap_content"         android:layout_height="fill_parent"         android:layout_margin="2dp"         android:layout_weight="1"         android:background="@drawable/an1" />      <button         android:id="@+id/button3"         android:layout_width="wrap_content"         android:layout_height="fill_parent"         android:layout_margin="2dp"         android:layout_weight="1"         android:background="@drawable/an1" />      <button         android:id="@+id/button4"         android:layout_width="wrap_content"         android:layout_height="fill_parent"         android:layout_margin="2dp"         android:layout_weight="1"         android:background="@drawable/an1" />      <button         android:id="@+id/button5"         android:layout_width="wrap_content"         android:layout_height="fill_parent"         android:layout_margin="2dp"         android:layout_weight="1"         android:background="@drawable/an1" /> </linearlayout>  <linearlayout     android:id="@+id/row2"     android:layout_width="fill_parent"     android:layout_height="wrap_content"     android:layout_weight="1"     android:orientation="horizontal"    >      <button         android:id="@+id/button6"         android:layout_width="wrap_content"         android:layout_height="fill_parent"         android:layout_margin="2dp"         android:layout_weight="1"         android:background="@drawable/an1" />      <button         android:id="@+id/button7"         android:layout_width="wrap_content"         android:layout_height="fill_parent"         android:layout_margin="2dp"         android:layout_weight="1"         android:background="@drawable/an1" />      <button         android:id="@+id/button8"         android:layout_width="wrap_content"         android:layout_height="fill_parent"         android:layout_margin="2dp"         android:layout_weight="1"         android:background="@drawable/an1" />       <button         android:id="@+id/button9"         android:layout_width="wrap_content"         android:layout_height="fill_parent"         android:layout_margin="2dp"         android:layout_weight="1"         android:background="@drawable/an1" />      <button         android:id="@+id/button10"         android:layout_width="wrap_content"         android:layout_height="fill_parent"         android:layout_margin="2dp"         android:layout_weight="1"         android:background="@drawable/an1" /> </linearlayout>  <linearlayout     android:id="@+id/row3"     android:layout_width="fill_parent"     android:layout_height="wrap_content"     android:layout_weight="1"     android:orientation="horizontal"  >      <button         android:id="@+id/button11"         android:layout_width="wrap_content"         android:layout_height="fill_parent"         android:layout_margin="2dp"         android:layout_weight="1"         android:background="@drawable/an1" />      <button         android:id="@+id/button12"         android:layout_width="wrap_content"         android:layout_height="fill_parent"         android:layout_margin="2dp"         android:layout_weight="1"         android:background="@drawable/an1" />      <button         android:id="@+id/button13"         android:layout_width="wrap_content"         android:layout_height="fill_parent"         android:layout_margin="2dp"         android:layout_weight="1"         android:background="@drawable/an1" />       <button         android:id="@+id/button14"         android:layout_width="wrap_content"         android:layout_height="fill_parent"         android:layout_margin="2dp"         android:layout_weight="1"         android:background="@drawable/an1" />      <button         android:id="@+id/button15"         android:layout_width="wrap_content"         android:layout_height="fill_parent"         android:layout_margin="2dp"         android:layout_weight="1"         android:background="@drawable/an1" /> </linearlayout>  <linearlayout     android:id="@+id/row4"     android:layout_width="fill_parent"     android:layout_height="wrap_content"     android:layout_weight="1"     android:orientation="horizontal"        >      <button         android:id="@+id/button16"         android:layout_width="wrap_content"         android:layout_height="fill_parent"         android:layout_margin="2dp"         android:layout_weight="1"         android:background="@drawable/an1" />      <button         android:id="@+id/button17"         android:layout_width="wrap_content"         android:layout_height="fill_parent"         android:layout_margin="2dp"         android:layout_weight="1"         android:background="@drawable/an1" />      <button         android:id="@+id/button18"         android:layout_width="wrap_content"         android:layout_height="fill_parent"         android:layout_margin="2dp"         android:layout_weight="1"         android:background="@drawable/an1" />       <button         android:id="@+id/button19"         android:layout_width="wrap_content"         android:layout_height="fill_parent"         android:layout_margin="2dp"         android:layout_weight="1"         android:background="@drawable/an1" />      <button         android:id="@+id/button20"         android:layout_width="wrap_content"         android:layout_height="fill_parent"         android:layout_margin="2dp"         android:layout_weight="1"         android:background="@drawable/an1" /> </linearlayout>  <linearlayout     android:id="@+id/row5"     android:layout_width="fill_parent"     android:layout_height="wrap_content"     android:layout_weight="1"     android:orientation="horizontal"     >      <button         android:id="@+id/button21"         android:layout_width="wrap_content"         android:layout_height="fill_parent"         android:layout_margin="2dp"         android:layout_weight="1"         android:background="@drawable/an1" />      <button         android:id="@+id/button22"         android:layout_width="wrap_content"         android:layout_height="fill_parent"         android:layout_margin="2dp"         android:layout_weight="1"         android:background="@drawable/an1" />      <button         android:id="@+id/button23"         android:layout_width="wrap_content"         android:layout_height="fill_parent"         android:layout_margin="2dp"         android:layout_weight="1"         android:background="@drawable/an1" />       <button         android:id="@+id/button24"         android:layout_width="wrap_content"         android:layout_height="fill_parent"         android:layout_margin="2dp"         android:layout_weight="1"         android:background="@drawable/an1" />      <button         android:id="@+id/button25"         android:layout_width="wrap_content"         android:layout_height="fill_parent"         android:layout_margin="2dp"         android:layout_weight="1"         android:background="@drawable/an1" /> </linearlayout>  <linearlayout     android:id="@+id/row6"     android:layout_width="fill_parent"     android:layout_height="wrap_content"     android:layout_weight="1"     android:orientation="horizontal"      >      <button         android:id="@+id/button26"         android:layout_width="wrap_content"         android:layout_height="fill_parent"         android:layout_margin="2dp"         android:layout_weight="1"         android:background="@drawable/an1" />      <button         android:id="@+id/button27"         android:layout_width="wrap_content"         android:layout_height="fill_parent"         android:layout_margin="2dp"         android:layout_weight="1"         android:background="@drawable/an1" />      <button         android:id="@+id/button28"         android:layout_width="wrap_content"         android:layout_height="fill_parent"         android:layout_margin="2dp"         android:layout_weight="1"         android:background="@drawable/an1" />      <button         android:id="@+id/button29"         android:layout_width="wrap_content"         android:layout_height="fill_parent"         android:layout_margin="2dp"         android:layout_weight="1"         android:background="@drawable/an1" />      <button         android:id="@+id/button30"         android:layout_width="wrap_content"         android:layout_height="fill_parent"         android:layout_margin="2dp"         android:layout_weight="1"         android:background="@drawable/an1" /> </linearlayout>   <linearlayout     android:id="@+id/row7"     android:layout_width="fill_parent"     android:layout_height="wrap_content"     android:layout_weight="1"     android:orientation="horizontal"      >      <button         android:id="@+id/button31"         android:layout_width="wrap_content"         android:layout_height="fill_parent"         android:layout_margin="2dp"         android:layout_weight="1"         android:background="@drawable/an1" />      <button         android:id="@+id/button32"         android:layout_width="wrap_content"         android:layout_height="fill_parent"         android:layout_margin="2dp"         android:layout_weight="1"         android:background="@drawable/an1" />      <button         android:id="@+id/button33"         android:layout_width="wrap_content"         android:layout_height="fill_parent"         android:layout_margin="2dp"         android:layout_weight="1"         android:background="@drawable/an1" />      <button         android:id="@+id/button34"         android:layout_width="wrap_content"         android:layout_height="fill_parent"         android:layout_margin="2dp"         android:layout_weight="1"         android:background="@drawable/an1" />      <button         android:id="@+id/button35"         android:layout_width="wrap_content"         android:layout_height="fill_parent"         android:layout_margin="2dp"         android:layout_weight="1"         android:background="@drawable/an1" />  </linearlayout>   <linearlayout     android:id="@+id/bottomrow"     android:layout_width="fill_parent"     android:layout_height="wrap_content"     android:layout_weight="1"     android:orientation="horizontal"      >      <button         android:id="@+id/bl"         android:layout_width="wrap_content"         android:layout_height="fill_parent"         android:layout_margin="2dp"         android:layout_weight="1"         android:background="@drawable/an1" />      <button         android:id="@+id/findme"         android:layout_width="wrap_content"         android:layout_height="fill_parent"         android:layout_margin="2dp"         android:layout_weight="1"         android:background="@drawable/an1" />      <button         android:id="@+id/buttonbr"         android:layout_width="wrap_content"         android:layout_height="fill_parent"         android:layout_margin="2dp"         android:layout_weight="1"         android:background="@drawable/an1" /> </linearlayout>  </linearlayout> 

bottom linear layout gets cut in half off screen

i needed edit height of rows "0dp"


Comments