9-patch 图像应该在 9-patch 标记处有透明边框: http://developer.android.com/guide/developing/tools/draw9patch.html
但我有 9 block 图像,图像的一部分多了 4 个像素。我已将它们标记为尺寸不大的部分,但它们会被完全忽略,只会显示不透明的像素。
如何将透明图像像素标记为图像部分?
最佳答案
你好,
像这样尝试:
<ImageButton
android:id="@+id/imgButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/refresh_icon"
android:background="@drawable/background_image">
资源:
关于android: 9 带有透明边框的补丁图像作为图像的一部分,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9223922/