title: Styling Custom ListView
body: <p>I've created something similar to a listview via a xml file containing an ImageView and TextView and using the LayoutInflater.</p>
  
  <p>It seems I've done this in quite an unorthodox way, as I can't figure out how to actually style the listview (ideally I want to define the size as there's other content to be put on the same interface)</p>
  
  <p>I've tried styling the LinearLayout inself, and putting the LinearLayout within a parent LinearLayout, including a ListView within the said file named 'list', trying to define a setContentView within the class which extends ListActivity.</p>
  
  <p>I would love just to be able to include the custom listview control into a LinearLayout just like any other control, rather than the control being the entire UI.</p>
  
  <pre><code>public class ImageActivity extends ArrayAdapter&lt;PlaceStore&gt; {
  
      private final Context context;
      private final List&lt;PlaceStore&gt; places;
  
      public ImageActivity(Context context, List&lt;PlaceStore&gt; places) {
          super(context, R.layout.image_text_row, places);
          this.context = context;
          this.places = places;
      }
  
      @Override
      public View getView(int position, View convertView, ViewGroup parent) {
          LayoutInflater inflater = (LayoutInflater) context
              .getSystemService(Context.LAYOUT_INFLATER_SERVICE);
  
          View rowView = inflater.inflate(R.layout.image_text_row, parent, false);
  
          TextView textView = (TextView) rowView.findViewById(R.id.label);
          ImageView imageView = (ImageView) rowView.findViewById(R.id.logo);
          textView.setText(places.get(position).getName());
  
          return rowView;
      }
  
  
  public class FavouriteActivity extends ListActivity{
  
  
      public void onCreate(Bundle savedInstanceState) {
  
           super.onCreate(savedInstanceState);
  
           setContentView(R.layout.favourite);
  
           FavouriteData data = new FavouriteData(this);
  
           List&lt;PlaceStore&gt; pS = data.returnFileData();
  
           setListAdapter(new ImageActivity(this, pS));
  
      }
  </code></pre>
  
  <p>R.layout.image_text_row</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;    
  &lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
      android:layout_width="fill_parent"
      android:layout_height="fill_parent"
      android:padding="5dp" android:background="@drawable/background_type" &gt;
  
  
      &lt;ImageView
          android:id="@+id/logo"
          android:layout_width="50dp"
          android:layout_height="50dp"
          android:layout_marginLeft="5dp"
          android:layout_marginRight="20dp"
          android:layout_marginTop="5dp"
          android:src="@drawable/androidmarker" &gt;
      &lt;/ImageView&gt;
  
      &lt;TextView
          android:id="@+id/label"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:text="@+id/label"
          android:textSize="20sp" &gt;
      &lt;/TextView&gt;
  
      &lt;/LinearLayout&gt;
  </code></pre>