absolutelayout 实现图片重叠
16lz
2021-01-26
问题已经解决。我选用的是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>
<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>
更多相关文章
- Android拆分Bitmap完整示例
- android bitmap oom
- 缩放图片 : matrix.setScale(0.5f,0.5f);
- Android(安卓)Gallery获取滑动停止的位置
- Android(安卓)将bitmap保存为本地png图片
- java.lang.RuntimeException: Unable to start activity Compone
- 使用Toast显示提示信息框
- Android(安卓)webview实现上传图片的效果(图片压缩)
- [Android]调用系统相册获取图片