Layer_list(层叠图片)

layer_list.xml(定义在Drawable-hdpi文件夹下)


<layer-list xmlns:android="http://schemas.android.com/apk/res/android" >
    <item>
        <bitmap android:src="@drawable/hd_1"
            android:gravity="center"/>
    item>
    <item android:top="10dp" android:left="10dp">
        <bitmap android:src="@drawable/hd_2"
            android:gravity="center"/>
    item>
    <item android:top="10dp" android:left="20dp">
        <bitmap android:src="@drawable/hd_3"
            android:gravity="center"/>
    item>

layer-list>

layout_main.xml

"http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:paddingBottom="@dimen/activity_vertical_margin"
    android:paddingLeft="@dimen/activity_horizontal_margin"
    android:paddingRight="@dimen/activity_horizontal_margin"
    android:paddingTop="@dimen/activity_vertical_margin"
    tools:context="com.example.hd.layer_list.MainActivity" >

    "wrap_content"
       android:layout_width="wrap_content"
       android:src="@drawable/layer_drawble"/>

    

你可能感兴趣的:(android)