EditText中的drawableLeft和drawableStart有什么区别? [英] What's the different between drawableLeft and drawableStart in EditText?

查看:73
本文介绍了EditText中的drawableLeft和drawableStart有什么区别?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

起初,我以为当将系统语言更改为阿拉伯语(从右到左书写的语言)时,drawableStart会自动更改图标的位置.但是当我这样做时,什么也没发生.所以我猜他们是一样的吗?

At first I thought drawableStart would auto change the icon's location when I changed system language to Arabic, which is a language written from right to left. But when I did that, nothing happened. So I guess they are the same?

推荐答案

我不确定以上答案是否正确.根据我的实验,除非您更改语言并启用RTL支持,否则该图标始终位于同一位置.

I'm not sure the answer above is correct. From my experimentation, the icon always ends up in the same place unless you change the language AND enable RTL support.

drawableStart drawableEnd 仅在您

将应用程序的所有左/右"布局属性更改为新的等价于开始/结束".

Change all of your app's "left/right" layout properties to new "start/end" equivalents.

  • 如果您要将应用程序定位到Android 4.2(应用程序的targetSdkVersion或minSdkVersion为17或更高),则应该
    使用开始"和结束",而不是左"和右".例如,
    android:paddingLeft应该变成android:paddingStart.

  • If you are targeting your app to Android 4.2 (the app's targetSdkVersion or minSdkVersion is 17 or higher), then you should
    use "start" and "end" instead of "left" and "right". For example,
    android:paddingLeft should become android:paddingStart.

如果您希望您的应用程序使用低于Android 4.2的版本(该应用程序的targetSdkVersion或minSdkVersion为16或更小),则您可以除左"和右"外,还应添加开始"和结束".为了例如,您将同时使用android:paddingLeft和android:paddingStart.

If you want your app to work with versions earlier than Android 4.2 (the app's targetSdkVersion or minSdkVersion is 16 or less), then you should add "start" and end" in addition to "left" and "right". For example, you’d use both android:paddingLeft and android:paddingStart.

这篇关于EditText中的drawableLeft和drawableStart有什么区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆