Note that there are some explanatory texts on larger screens.

plurals
  1. POHow do I avoid double borders between lists?
    primarykey
    data
    text
    <p>I am using a list view in which I have an xml referencing drawable/list as follows:</p> <pre><code>&lt;layer-list xmlns:android="http://schemas.android.com/apk/res/android" &gt; //For the borders &lt;item&gt; &lt;shape android:shape="rectangle"&gt; &lt;solid android:color="@color/white" /&gt; &lt;corners android:radius="0dp" /&gt; &lt;/shape&gt; &lt;/item&gt; //For the background color of cells &lt;item android:top="1px" android:left="0dp" android:right="0dp" android:bottom="1px"&gt; &lt;shape android:shape="rectangle"&gt; &lt;solid android:color="#262626" /&gt; &lt;corners android:radius="0dp" /&gt; &lt;/shape&gt; &lt;/item&gt; &lt;/layer-list&gt; </code></pre> <p>The above code is basically used to define the borders and the background color of cells. However, I want to be able to use line for the borders instead of rectangle so that the bottom border of one rectangle doesnt leave a 1 dp gap between the top border of another rectangle below it. Please refer the image below: </p> <p><img src="https://i.stack.imgur.com/52cBK.jpg" alt="enter image description here"></p> <p>As you can see from the image, the rectangular bottom border below BOK.L is a little off showing a gap between the top rectangular border of GOOG.OQ Is there a way to fix this such that both the borders either overlap on top of each other and no such double line gap appears or is there a way I can define a line shape such that it is defined above and below all the cells in the pic without a gap? </p> <p>Any clue?</p> <p>Thanks! Justin</p> <p>The xml file referencing the same (drawable/list) is as follows :</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" android:background="@drawable/list" android:padding="4dp" &gt; &lt;TextView android:id="@+id/symbol" android:layout_width="match_parent" android:layout_height="wrap_content" android:paddingTop="2dp" android:paddingLeft="8dp" android:textColor="@color/search_autosuggest_header_text" foo:customFont="Roboto-Bold.ttf" android:singleLine="true" android:layout_toLeftOf="@+id/last_container" android:ellipsize="end" android:gravity="left" android:textSize="14sp"/&gt; &lt;TextView android:id="@+id/name" android:layout_width="wrap_content" android:layout_height="wrap_content" android:paddingLeft="8dp" foo:customFont="Roboto-Regular.ttf" android:layout_alignParentLeft="true" android:layout_below="@id/symbol" android:layout_toLeftOf="@+id/last_container" android:paddingBottom="4dp" android:textColor="@color/search_autosuggest_item_subtitle" android:singleLine="true" android:ellipsize="end" android:textSize="11sp" /&gt; &lt;FrameLayout android:id="@+id/last_container" android:layout_width="87dp" android:layout_height="wrap_content" android:layout_margin="1dp" android:layout_toLeftOf="@+id/net_change_container" &gt; &lt;TextView android:id="@+id/last_back" style="@style/TextView.ListsTextView" android:layout_width="87dp" android:layout_height="wrap_content" android:padding="3dp" /&gt; &lt;TextView android:id="@+id/last" style="@style/TextView.ListsTextView" android:layout_width="87dp" android:textSize="12sp" android:layout_height="wrap_content" /&gt; &lt;/FrameLayout&gt; &lt;FrameLayout android:id="@+id/net_change_container" android:layout_width="80dp" android:layout_height="wrap_content" android:layout_margin="1dp" android:layout_toLeftOf="@+id/percent_change_container" &gt; &lt;TextView android:id="@+id/net_change_back" style="@style/TextView.ListsTextView" android:layout_width="80dp" android:layout_height="wrap_content" android:padding="3dp" /&gt; &lt;TextView android:id="@+id/net_change" style="@style/TextView.ListsTextView" android:layout_width="80dp" android:textSize="12sp" android:layout_height="wrap_content" /&gt; &lt;/FrameLayout&gt; &lt;FrameLayout android:id="@+id/percent_change_container" android:layout_width="65dp" android:layout_height="wrap_content" android:layout_alignParentRight="true" android:layout_margin="1dp" &gt; &lt;TextView android:id="@+id/percent_change_back" style="@style/TextView.ListsTextView" android:layout_width="65dp" android:textSize="14sp" foo:customFont="Roboto-Regular.ttf" android:layout_height="wrap_content" android:padding="3dp" /&gt; &lt;TextView android:id="@+id/percent_change" style="@style/TextView.ListsTextView" android:layout_width="65dp" android:textSize="12sp" android:layout_height="wrap_content"/&gt; &lt;/FrameLayout&gt; &lt;/RelativeLayout&gt; </code></pre> <p>Also,@jboi with with your fix the screen that I get is: <img src="https://i.stack.imgur.com/1GvPN.jpg" alt="enter image description here"></p>
    singulars
    1. This table or related slice is empty.
    plurals
    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