如何删除RelativeLayout中元素的默认间距?
我尝试设置负边距和权重属性,但没有得到任何结果。
我正在尝试删除该空间,以使我没有ListView行的垂直长度。
这个人在做类似的事情,这是我遇到的第二个问题,但是这种边际收益为负的方法行不通。How do I reduce the padding around text in Android xml layout?
您如何删除该空间?
单元格XML的较短版本:
<LinearLayout xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/OrderRows"
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<RelativeLayout
style="?commonRowStyle"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_alignParentBottom="true"
android:layout_marginStart="0sp"
android:layout_marginEnd="0sp"
android:orientation="vertical">
<TextView
android:id="@+id/orderStatus"
style="?orderParameterStyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:includeFontPadding="false"
android:text="@string/orderStatusSuspendedMobile"
android:textSize="@dimen/textSizeSecondary" />
<TextView
android:id="@+id/filled"
style="?orderParameterStyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="end"
android:includeFontPadding="false"
android:text="filled"
android:textSize="10sp" />
</LinearLayout>
</RelativeLayout>
删除此样式
style="?commonRowStyle"