问题:
How do you add a background image to a shape?如何将背景图像添加到形状? The code I tried below but no success:我在下面尝试过但没有成功的代码:
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle" android:padding="10dp">
//here is where i need to set the image
<solid android:color="@drawable/button_image"/>
<corners
android:bottomRightRadius="5dp"
android:bottomLeftRadius="5dp"
android:topLeftRadius="5dp"
android:topRightRadius="5dp"/>
</shape>
解决方案:
参考一: https://en.stackoom.com/question/1Q7dY参考二: https://stackoom.com/question/1Q7dY