首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >android:paddingLeft给出错误?

android:paddingLeft给出错误?
EN

Stack Overflow用户
提问于 2014-10-08 15:58:47
回答 4查看 6.2K关注 0票数 0
代码语言:javascript
复制
Multiple annotations found at this line:
- Consider replacing android:paddingLeft with android:paddingStart="5dp" to better support 
 right-to-left layouts
- When you define paddingLeft you should probably also define paddingRight for right-to-left 
 symmetry

在我的xml文件中,我得到了为什么会发生这种类型的错误,任何人都知道为什么会发生这种情况。

这是我的xml文件

代码语言:javascript
复制
 <LinearLayout
                android:id="@+id/titles"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:orientation="vertical"
                android:paddingLeft="10dp"  // here am getting that error
                android:paddingTop="10dp" >

                <TextView
                    android:id="@+id/productTitle"
                    style="@style/darkGreyMediumText14"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:maxLines="3"
                   android:scrollHorizontally="true"
                    android:text="Samsung  " />
                />
EN

回答 4

Stack Overflow用户

发布于 2014-10-10 22:02:17

添加属性tools:ignore="RtlSymmetry"以删除此警告/错误。不过,这不应该是一个错误。

票数 6
EN

Stack Overflow用户

发布于 2015-07-13 12:23:44

我遵循Mr.Vinay Wadhwa的指示来修复问题,但是在实现时间上我有点困惑,我必须使用这个代码,所以这就是为什么我必须把这个代码放在清晰的引用中。

在父布局中包含此属性

  1. xmlns:tools="http://schemas.android.com/tools"
  2. tools:ignore="RtlSymmetry“

http://schemas.android.com/apk/res/android“xmlns:tools="http://schemas.android.com/tools”android:layout_width="match_parent“android:layout_height="wrap_content”android:orientation="vertical“tools:ignore="RtlSymmetry”>

票数 4
EN

Stack Overflow用户

发布于 2016-12-02 18:05:37

你可以用相同的value.So添加android:paddingLeft="10dp"android:paddingStart="10dp",当android渲染RTL布局时,它会考虑paddingStart,否则paddingLeft..

https://developer.android.com/about/versions/android-4.2.html#RTL

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/26251876

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档