Note that there are some explanatory texts on larger screens.

plurals
  1. POmake listview RelativeLayout align on every item
    text
    copied!<p>I have a problem using lsitview relativelayout on android, results do not match what I want,</p> <p>result look like this;</p> <p><img src="https://i.stack.imgur.com/d5IYP.jpg" alt="enter image description here"></p> <p>mycode;</p> <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" &gt; &lt;TextView android:id="@+id/textView1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Large Text" android:textAppearance="?android:attr/textAppearanceLarge" /&gt; &lt;TextView android:id="@+id/textView4" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignLeft="@+id/textView3" android:layout_below="@+id/textView3" android:text="Large Text" android:textAppearance="?android:attr/textAppearanceLarge" /&gt; &lt;TextView android:id="@+id/textView5" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignLeft="@+id/textView4" android:layout_below="@+id/textView4" android:text="Large Text" android:textAppearance="?android:attr/textAppearanceLarge" /&gt; &lt;TextView android:id="@+id/textView2" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentTop="true" android:layout_marginLeft="25dp" android:layout_toRightOf="@+id/textView1" android:text="Large Text" android:textAppearance="?android:attr/textAppearanceLarge" /&gt; &lt;TextView android:id="@+id/textView3" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentTop="true" android:layout_marginLeft="25dp" android:layout_toRightOf="@+id/textView2" android:text="Large Text" android:textAppearance="?android:attr/textAppearanceLarge" /&gt; &lt;TextView android:id="@+id/textView7" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignLeft="@+id/textView6" android:layout_below="@+id/textView6" android:text="Large Text" android:textAppearance="?android:attr/textAppearanceLarge" /&gt; &lt;TextView android:id="@+id/textView6" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentTop="true" android:layout_marginLeft="25dp" android:layout_toRightOf="@+id/textView3" android:text="Large Text" android:textAppearance="?android:attr/textAppearanceLarge" /&gt; &lt;/RelativeLayout&gt; </code></pre> <p>I want to make it align each item, like a table, to make it more presentable and easier to read like this</p> <p><img src="https://i.stack.imgur.com/Ig9nY.jpg" alt="enter image description here"></p> <p>NOTE: it's a listview, I use this code to put it with <code>android xml layout file</code>, code above is for <code>list1</code> <code>xml layout file</code> and below is in <code>activity</code></p> <pre><code>ListAdapter adapter = new SimpleAdapter(LihatBangsal.this, mylistRuper, R.layout.list1, new String[] { "ruper", "kelas", "nama", "noregis", "rm","umur", "jk" }, new int[] { R.id.textView1, R.id.textView2,R.id.textView3, R.id.textView4, R.id.textView5, R.id.textView6, R.id.textView7}); listBangsal.setAdapter(adapter); </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