I have a list with an adapter, and with this element:
<?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="vertical" android:paddingLeft="5dp" android:paddingTop="5dp" android:paddingRight="5dp" android:paddingBottom="5dp"> <android.support.v7.widget.CardView android:layout_width="wrap_content" android:layout_height="wrap_content"> <RelativeLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginStart="5dp" android:layout_marginEnd="5dp" android:gravity="center_vertical|center_horizontal" android:orientation="horizontal"> <TextView android:id="@+id/title" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginEnd="90dp" android:ellipsize="end" android:gravity="center_horizontal" android:singleLine="true"/> <TextView android:id="@+id/date" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginStart="250dp" android:gravity="end" android:textSize="12sp" /> </RelativeLayout> <RelativeLayout android:layout_width="match_parent" android:layout_height="match_parent" android:layout_marginStart="5dp" android:layout_marginTop="20dp" android:layout_marginEnd="30dp"> <TextView android:id="@+id/address" android:layout_width="wrap_content" android:layout_height="wrap_content" android:ellipsize="end" android:gravity="center_vertical" android:singleLine="true" /> </RelativeLayout> <RelativeLayout android:layout_width="match_parent" android:layout_height="match_parent" android:layout_marginStart="5dp" android:layout_marginTop="40dp" android:layout_marginEnd="5dp"> <TextView android:id="@+id/company" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginEnd="5dp" android:ellipsize="end" android:gravity="center_vertical" android:singleLine="true" /> </RelativeLayout> </android.support.v7.widget.CardView> </LinearLayout> Data in the list drag on the server response, the answer comes in json. Strange problem - in some elements the appearance of a space in the line responsible for the title (title) is noticed. Already checked in every way:
- I looked at what comes from the server - everything is fine.
- Checked the presence of a space at the beginning of the lines - nothing.
- I looked in the database from where the infa server is pulled - there are no gaps.
The space does not appear in every element, but in some, and visually it is very ugly. It seems there are no spaces, but they are displayed. Changed the markup - it did not help. In the end, I could not find the problem. Most likely the error is somewhere in the markup, but I can not understand exactly where.

margininRelativeLayoutinCardView. - Yuriy SPb ♦ 2:13 pm