【问题标题】:What's the use of ImageButtonImageButton有什么用
【发布时间】:2012-03-08 12:19:19
【问题描述】:

如果可以在 Button 上设置背景,那么 ImageButton 有什么用?

【问题讨论】:

  • 但我们不能在 Button 中设置 android:src。
  • 但即使这样也有同样的目的。
  • “但即使这样也有同样的目的”——不,它没有。 ImageButton 允许您为前景和背景指定单独的图像。

标签: android android-layout


【解决方案1】:

使用ImageButton(就像使用Image)可以控制android:src定义的图像在按钮上的显示方式:您可以设置scaleType - 这是您无法对背景执行的操作。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-08-19
    • 1970-01-01
    • 2017-03-30
    • 2012-03-26
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多