title: android listView row height
body: <p>I implemented a listview with 2 kinds of rows from here <a href="http://logc.at/2011/10/10/handling-listviews-with-multiple-row-types/" rel="nofollow">listViews with multiple rows tutorial</a></p>
  
  <p>all is working properly,</p>
  
  <p>the problem that I have now is setting the height for the rows,</p>
  
  <p>if I leave the background as a color, all is good,</p>
  
  <p>but if I use an image for background, I only get a tall row [on other simple list views the height respect the programatically set height], but in this case, the row changes</p>
  
  <p>so </p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
   &lt;LinearLayout 
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/category_item_row"
    android:orientation="horizontal" 
    android:layout_width="fill_parent"
    android:background="#ff00ff"
    android:layout_height="70dp"
    android:padding="3dp"
   &gt;
  
  &lt;ImageView
   android:id="@+id/image"
   android:layout_width="40dp"
   android:layout_height="70dp"
   android:gravity="center_vertical"/&gt;
  
  &lt;TextView
   android:id="@+id/title"
   android:textSize="20sp"
   android:layout_width="90dp"
   android:layout_height="70dp"
   android:gravity="center_vertical"/&gt;
  &lt;/LinearLayout&gt;
  </code></pre>
  
  <p>works fine,</p>
  
  <p>but </p>
  
  <pre><code>android:background="@drawable/phone_cat_cell"&gt;
  </code></pre>
  
  <p>is not respecting the assigned  height,</p>
  
  <p>how to fix this height using my image background?</p>
  
  <p>thanks!</p>
  
  <p>edit 1, adapter</p>
  
  <pre><code>listViewItem.setAdapter(new PhoneItemAdapter(new ItemPhoneDataSource().getItems()));
  
  private class PhoneItemAdapter extends BaseAdapter {  
      final List&lt;RowPhone&gt; rows;//row
  
      //data source, style
      PhoneItemAdapter(List&lt;ItemPhone&gt; animals) {
          rows = new ArrayList&lt;RowPhone&gt;();//member variable
  
          //choose cell! iterator
          for (ItemPhone item : animals) {
              //if it has an image, use an ImageRow
              if (item.getImageId() != null) {
                  rows.add(new RowFolderPhone(LayoutInflater.from(getActivity()), item)); //imageRow!
              } else {//otherwise use a DescriptionRow
  
                  rows.add(new RowItemPhone(LayoutInflater.from(getActivity()), item));                   
              }
          }
      }
  
      //delegate
      @Override
      public int getViewTypeCount() {
          return RowTypePhone.values().length;
      }
  
      @Override
      public int getItemViewType(int position) {
          //con cast
          return ((RowPhone) rows.get(position)).getViewType();
  
      }
  
      public int getCount() {
          return rows.size();
      }
  
      public Object getItem(int position) {
          return position;
      }
  
      public long getItemId(int position) {
          return position;
      }
  
      public View getView(int position, View convertView, ViewGroup parent) {
  
          //cambiado con cast!
          return ((RowPhone) rows.get(position)).getView(convertView);
      }
     }
  </code></pre>