我在我的应用中有很多LinearLayout
都使用了这个背景:
android:background="@drawable/metal_plate"
drawable\metal_plate.xml:
<bitmap xmlns:android="http://schemas.android.com/apk/res/android"
android:src="@drawable/diamond_metal"
android:tileMode="repeat"
android:dither="true">
</bitmap>
我希望在金属板的四个角上放置四个螺丝的位图。
由于我在几个地方都会使用这个金属板,因此我更喜欢将其定义为单个可绘制对象,而不是每次都需要使用 RelativeLayout
放置四个螺丝。
是否有可能在 drawable 文件夹中定义一个 XML 来组合平铺的金属板和四个螺丝?