-1
我想要在描述文本和交換機之間填充填充,但paddingRight屬性不起作用。爲什麼?Android:填充不能在RelativeLayout中工作
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/layoutLayout"
android:layout_below="@+id/layoutHeader"
android:layout_marginTop="15dp"
android:layout_marginLeft="15dp"
android:layout_marginRight="15dp">
<Switch
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/widgetShortSwitch"
android:layout_centerVertical="true"
android:layout_alignParentRight="true" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="This is a long description text that should not overlay."
android:textColor="#000000"
android:paddingRight="15dp"
android:id="@+id/widgetShortTextView"
android:layout_centerVertical="true"
android:layout_alignParentLeft="true"
/>
</RelativeLayout>
太棒了。當您將「dp」單位添加到layout_widths時,它是完美的。 – Kewitschka