【问题标题】:How to remove extra space in button when using drawable使用drawable时如何删除按钮中的多余空间
【发布时间】:2013-12-07 17:36:17
【问题描述】:

我有一个Button,没有文字,右侧有一个通过setCompoundDrawablesWithIntrinsicBounds 添加的可绘制对象。但是,在左侧,我想删除一些未使用的空间。有没有办法做到这一点?我发现以某种方式解决此问题的唯一方法是设置按钮的填充以使可绘制对象居中。

【问题讨论】:

标签: android button drawable


【解决方案1】:

如果您不使用文本,则应使用 ImageButton。

只需设置 setBackgroundDrawable 并快乐 ^^

【讨论】:

    猜你喜欢
    • 2011-05-26
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2022-10-20
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多