3.1.4 ImageView控件

<androidx.constraintlayout.widget.ConstraintLayout

xmlns:android="http://schemas.android.com/apk/res/android "
xmlns:app="http://schemas.android.com/apk/res-auto "
xmlns:tools="http://schemas.android.com/tools "
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity">

</androidx.constraintlayout.widget.ConstraintLayout>

请把上面的结构改成相对布局
然后有二个imageview控件
一张是背景图片,一张是logo图片(位置在左上角)



<ImageView
android:id="@+id/image_logo"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_alignParentStart="true"
android:layout_marginTop="10dp"
android:layout_marginEnd="10dp"
android:src="@drawable/logo_image" />

背景图片是bg.png,logo是icon.png,请修正上面的代码



uploading-image-934919.png

posted @ 2025-03-26 18:34  大胡子编程  阅读(87)  评论(0)    收藏  举报