Note that there are some explanatory texts on larger screens.

plurals
  1. POproblem with custom ListView showing 3 vertical TextViews
    text
    copied!<p>im trying to display 3 TextViews as a custom row design in a ListView. Unfortunatly, only 2 TextViews ( row_title and row_postcode_city) are visible... </p> <p>Maybe somebody has an idea?</p> <p>Regards, float</p> <p>Code of my ArrayAdapter:</p> <pre><code>private class PartnerAdapter extends ArrayAdapter&lt;Partner&gt; { private ArrayList&lt;Partner&gt; items; public PartnerAdapter(Context context, int textViewResourceId, ArrayList&lt;Partner&gt; items) { super(context, textViewResourceId, items); this.items = items; } @Override public View getView(int position, View convertView, ViewGroup parent) { View v = convertView; if (v == null) { LayoutInflater vi = (LayoutInflater)getSystemService(Context.LAYOUT_INFLATER_SERVICE); v = vi.inflate(R.layout.partner_suche_ergebnis_row, parent, false); } Partner o = items.get(position); if (o != null) { TextView title = (TextView) v.findViewById(R.id.row_title); TextView subtitle = (TextView) v.findViewById(R.id.row_subtitle); TextView postcode_city = (TextView) v.findViewById(R.id.row_postcode_city); if (title != null) { title.setText(o.getTitle()); } if(subtitle != null){ subtitle.setText(o.getSubtitle()); } if(postcode_city != null){ subtitle.setText(o.getPostcode() + " " + o.getCity()); } } return v; } } </code></pre> <p>XML of the custom row design:</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="?android:attr/listPreferredItemHeight" android:padding="0dip"&gt;&lt;!-- &lt;ImageView android:id="@+id/icon" android:layout_width="wrap_content" android:layout_height="fill_parent" android:layout_marginRight="6dip" android:src="@drawable/icon" /&gt; --&gt;&lt;LinearLayout android:orientation="vertical" android:layout_width="wrap_content" android:layout_weight="1" android:layout_height="fill_parent"&gt; &lt;TextView android:id="@+id/row_title" android:layout_width="fill_parent" android:layout_height="wrap_content" style="bold"/&gt; &lt;TextView android:id="@+id/row_subtitle" android:layout_width="fill_parent" android:layout_height="wrap_content" /&gt; &lt;TextView android:id="@+id/row_postcode_city" android:layout_width="fill_parent" android:layout_height="wrap_content" /&gt; &lt;/LinearLayout&gt; &lt;/LinearLayout&gt; </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload