【发布时间】:2015-05-09 01:27:10
【问题描述】:
我是 android 的新手 ....我收到以下关于使用文本视图的警告 ..我不明白它的目的 .. 可以解释一下吗?
警告:
<TextView
android:id="@+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true" //warning1
android:layout_alignParentTop="true"
android:layout_marginLeft="82dp" //warning2
android:layout_marginTop="93dp"
android:text="@string/Test" />
警告1 考虑添加 android:layout_marginStart="82dp" 以更好地支持从右到左的布局 问题:查找可能是双向文本的开始/结束的硬编码左/右常量 id: RtlHardcoded
警告2 考虑添加 android:layout_alignParentStart="true" 以更好地支持从右到左的布局 问题:查找可能是双向文本的开始/结束的硬编码左/右常量 id: RtlHardcoded
【问题讨论】:
-
1 这些不是错误,只是警告(因此,不被视为有害)。 2 要删除它们,只需添加建议的行。
-
建议行是什么意思?你能解释一下吗?
-
没什么,只是一种新的抱怨方式... ;) 好的,这是为了更好地支持 RTL 语言。
标签: android xml layout textview