absolutelayout 实现图片重叠

来源:互联网 发布:单片机应用场合 编辑:程序博客网 时间:2024/06/05 05:07
 问题已经解决。我选用的是AbsoluteLayout方式布局。
<AbsoluteLayout
  xmlns:android="http://schemas.android.com/apk/res/android"
  android:layout_width="wrap_content"
  android:layout_height="wrap_content">
<ImageView
    android:src="@drawable/sample_1" --图片1
    android:adjustViewBounds="true"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_x="14.5sp"        ---绝对位置
    android:layout_y ="14.5sp"/>
  <ImageView
    android:src="@drawable/sample_2" --图片2
    android:adjustViewBounds="true"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_x="54.5sp"          --绝对位置
    android:layout_y ="64.5sp"/>   
</AbsoluteLayout>