警告
<span style="color:#FF0000;">Multiple annotations found at this line:
- Consider adding android:paddingStart="1dip" to better support right-to-left
layouts
- When you define paddingLeft you should probably also define paddingRight for
right-to-left symmetry</span>
警告代码如下
<ImageView
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:contentDescription="@null"
<span style="color:#FF0000;">android:paddingLeft="1dip"</span>
android:layout_gravity="center_horizontal"
android:src="@drawable/registered_logo_white"/>
分析原因
android:paddingstart是新推出的标签在Android 4.2(SDK17)起使用。
如果你的应用在4.2之后运行你可以使用
android:paddingStart="1dip"
如果你的应用在4.2之前运行或者是在任何版本使用你可以使用
android:paddingStart="1dip"
android:paddingLeft="1dip"
否则会报错
<span style="color:#FF0000;">Multiple annotations found at this line:
- To support older versions than API 17 (project specifies 11) you should *also* add
android:paddingLeft="1dip"
- When you define paddingStart you should probably also define paddingEnd for
right-to-left symmetry</span>
整体的代码
<ImageView
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:contentDescription="@null"
android:paddingStart="1dip"
android:paddingLeft="1dip"
android:paddingRight="0dip"
android:paddingEnd="0dip"
android:layout_gravity="center_horizontal"
android:src="@drawable/registered_logo_white"/>
这样就大功告成