【发布时间】:2016-10-12 10:36:22
【问题描述】:
我收到此类警告
@id/order_row_date 可以与@id/order_row_amout 重叠,如果 @id/order_row_date 由于本地化文本扩展而增长。
如果相对布局的文本或按钮项左对齐 由于本地化文本,它们可以相互重叠 扩展,除非它们具有相互约束,例如 toEndOf/toStartOf。
我的 XML 文件是:
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/order_row_lower_layout"
android:layout_below="@+id/order_row_upper_layout"
android:layout_toEndOf="@+id/order_row_box_layout"
android:layout_toRightOf="@+id/order_row_box_layout"
android:orientation="horizontal">
<android.support.v7.widget.AppCompatTextView
android:id="@+id/order_row_amout"
style="@style/TextAppearance.AppCompat.Title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/spacing_normal"
android:layout_marginRight="@dimen/spacing_normal"
android:textColor="@color/color_gray"
android:textStyle="bold"
android:text="50000"
tools:text="@string/string_amout_with_ruppe" />
<android.support.v7.widget.AppCompatTextView
android:id="@+id/order_row_date"
style="@style/TextAppearance.AppCompat.Subhead"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:layout_alignParentRight="true"
android:textColor="@color/color_gray"
tools:text="08/09/2016" />
</RelativeLayout>
有人知道这种类型的警告吗?
提前表示赞赏:)
【问题讨论】:
标签: android android-layout warnings android-relativelayout xml-layout