Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>It seems somewhat different when your listview is displayed if you code it like that. But even you can follow this too.</p> <p><strong>First define a style named <code>Line</code></strong></p> <pre><code>&lt;style name="Line"&gt; &lt;item name="android:layout_width"&gt;fill_parent&lt;/item&gt; &lt;item name="android:layout_height"&gt;2px&lt;/item&gt; &lt;item name="android:background"&gt;@color/white&lt;/item&gt; &lt;/style&gt; </code></pre> <p>// In the above style you can change the height of the line as per your requirement.</p> <p>Wherever you want to use the above line, you can declare it like this in your xml file.</p> <pre><code>&lt;LinearLayout android:orientation = "vertical" ....................... ............................&gt; &lt;ListView android:id="@android:id/list" android:layout_width="fill_parent" android:layout_height="wrap_content" /&gt; &lt;View style="@style/Line"/&gt; &lt;/LinearLayout&gt; </code></pre> <p>The above code creates a line under your listview. The above code is most useful when you wanna use it in various places in your project. Or if want at only one place, you can do it like this.</p> <pre><code> &lt;LinearLayout android:orientation = "vertical" ....................... ............................&gt; &lt;ListView android:id="@android:id/list" android:layout_width="fill_parent" android:layout_height="wrap_content" /&gt; &lt;View android:layout_width="fill_parent" android:layout_height="1px" android:background="#20b2aa" /&gt; &lt;/LinearLayout&gt; </code></pre> <p>Hope this helps. BTW The reason is vague and even once I did search for this and I followed this way which I explained above.</p>
 

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