【问题标题】:Android Studio Icon for Button does not fit按钮的 Android Studio 图标不适合
【发布时间】:2017-05-19 11:07:32
【问题描述】:

我的图标(大小 256*256)不适合按钮的大小,它是居中对齐的,所以小按钮显示为 并且任何人都让我的按钮适合按钮的原始大小并显示为必需图标对于按钮 。

更改图标的大小会使图标超出按钮大小的范围,请帮助我摆脱它。

我的代码是

<br.com.bloder.magic.view.MagicButton

    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_marginTop="10dp"
    android:layout_marginLeft="10dp"
    app:magic_button_size="50dp"
    app:button_icon="@drawable/three"
    app:button_icon_width="35dp"
    app:button_icon_height="35dp"
    app:hide_text="EigthSemester"
    app:icon_button_color="#ced0d4"
    app:expandable_area_color="#2f83de"/> 

【问题讨论】:

  • 能否提供布局xml?
  • 您是否为此按钮使用任何第三方库?还是这是标准的 android 按钮视图?
  • 编辑我的帖子请注意
  • 第三方库
  • 'com.github.bloder:magic:1.1'

标签: android android-studio button icons


【解决方案1】:

我查看了库,似乎图标“magic_button_size”和“button_icon_width”“button_icon_height”的大小是相连的。这些应该是magic_button_size 的50%。这就是图标不在中心的原因。

尝试将xml更改为:

   <br.com.bloder.magic.view.MagicButton
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_marginTop="10dp"
    android:layout_marginLeft="10dp"
    app:magic_button_size="50dp"
    app:button_icon="@drawable/three"
    app:button_icon_width="25dp"
    app:button_icon_height="25dp"
    app:hide_text="EigthSemester"
    app:icon_button_color="#ced0d4"
    app:expandable_area_color="#2f83de"/> 

【讨论】:

  • 他们有什么方法可以将链接从 50% 更改为 100% ,如果你能做到,那对我会有很大的帮助。
猜你喜欢
  • 2015-05-10
  • 1970-01-01
  • 1970-01-01
  • 2012-09-09
  • 1970-01-01
  • 2021-02-16
  • 1970-01-01
  • 1970-01-01
  • 2020-12-11
相关资源
最近更新 更多