【问题标题】:Shifting position of a drawable in edittext在edittext中移动drawable的位置
【发布时间】:2012-06-09 07:00:05
【问题描述】:

有谁知道如何将edittext的drawable的图像向左/向右移动???

我得到的是this

我要的是this:

【问题讨论】:

  • 请将您的布局xml文件放在这里。

标签: android android-layout android-widget android-edittext


【解决方案1】:

使用padding 你可以做到这一点...

android:paddingLeft="5dp"

【讨论】:

  • 非常感谢萨米尔。这浪费了我很多时间。
【解决方案2】:

在您的 xml 中添加以下行:

android:drawablePadding="5dip"

更多信息请参考Android developer reference

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2012-10-19
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-04-15
    • 1970-01-01
    相关资源
    最近更新 更多