当前位置: 代码迷 >> Android >> Consider adding android:paddingStart="1dip" to better support right-to-left layouts .
  详细解决方案

Consider adding android:paddingStart="1dip" to better support right-to-left layouts .

热度:200   发布时间:2016-04-27 23:47:38.0
Consider adding android:paddingStart="1dip" to better support right-to-left layouts ......

警告

<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"/>
这样就大功告成

版权声明:本文为博主原创文章,未经博主允许不得转载。

  相关解决方案