【发布时间】:2012-05-17 12:15:47
【问题描述】:
假设我想在按钮表面绘制简单的图标。让它成为十字架或某个字母。
最好的方法是什么?我可以在按钮上使用wingdings或webdings字体吗?
【问题讨论】:
标签: android button icons vector-graphics wingdings
假设我想在按钮表面绘制简单的图标。让它成为十字架或某个字母。
最好的方法是什么?我可以在按钮上使用wingdings或webdings字体吗?
【问题讨论】:
标签: android button icons vector-graphics wingdings
由于 Android 使用 Unicode (utf-8),您可以使用其中定义的任何符号,只要您的字体支持。只需使用复制和粘贴。我认为更好的解决方案是使用 ImageButton 使用 drawables 文件夹中的图像。这个文件夹可以在 project/res/drawables 或通过 Ecplipse Package-Explorer 找到,你应该使用它来复制和粘贴你的文件(支持 png、gif 和 jpg)
在 XML 布局文件中,图像通过以下方式分配给 ImageButton
<ImageButton
android:id="@+id/imageButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/ic_launcher" />
另见:
【讨论】: