Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Here is a very good example fo GridView with ImageView and TextView. </p> <p><a href="http://mytelcoit.com/2010/02/programming-android-create-icon-with-text-using-gridview-and-layout-inflater/" rel="nofollow">http://mytelcoit.com/2010/02/programming-android-create-icon-with-text-using-gridview-and-layout-inflater/</a></p> <p>Simply create a xml file with ImageView and textView like this,</p> <pre><code>&lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/widget44" android:layout_width="wrap_content" android:layout_height="wrap_content" android:orientation="vertical" android:layout_x="201px" android:layout_y="165px" android:gravity="center_horizontal"&gt; &lt;ImageView android:id="@+id/icon_image" android:layout_width="wrap_content" android:layout_height="wrap_content"&gt; &lt;/ImageView&gt; &lt;TextView android:id="@+id/icon_text" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="TextView" android:gravity="center_horizontal" android:textColorHighlight="#656565"&gt; &lt;/TextView&gt; &lt;/LinearLayout&gt; </code></pre> <p>And then use a custom Adapter to populate it. </p> <pre><code>@Override public View getView(int position, View convertView, ViewGroup parent) { // TODO Auto-generated method stub View v; if(convertView==null){ LayoutInflater li = getLayoutInflater(); v = li.inflate(R.layout.icon, null); TextView tv = (TextView)v.findViewById(R.id.icon_text); tv.setText("Profile "+position); ImageView iv = (ImageView)v.findViewById(R.id.icon_image); iv.setImageResource(R.drawable.icon); } else { v = convertView; } return v; } </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

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