我怎样才能将图像设置在 activity 的左下角并且在背景中

How can i set an image to be in the bottom left corner of an activity AND in the background

我想将我的应用程序的徽标设置在屏幕的左下角并处于背景中。我想这样做的原因是允许用户修改背景颜色,如果我只是将整个 activity 或布局背景设置为图像以提供相同的印象,这是不可能的。

另一种提问方式是如何将图像设置到左下角和其他控件下方?

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="@drawable/your_desired_full_background">


    <ImageView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:src="@drawable/ic_launcher_logo"
        android:layout_alignParentBottom="true"
        android:layout_alignParentLeft="true"/>
</RelativeLayout>

不知道我理解的对不对。但是你问的很简单。

<FrameLayout xmlns:android="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:background="#bbbbbb"
     >

    <ImageView
        android:layout_width="50dp"
        android:layout_height="50dp"
        android:layout_gravity="bottom|left"
        android:layout_margin="10dp"
        android:src="#ffff00" />

    <LinearLayout 
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:background="#00000000"
        android:orientation="vertical">

<!--         Put your views here -->

    </LinearLayout>

</FrameLayout>

您可以根据需要更改框架布局的背景,并将徽标保留在左下角。 您还可以将 LinearLayout(您可以使用任何布局。这取决于您)背景设置为透明,这样您就会看到背景。线性布局(您的视图容器)内的任何额外视图将始终位于顶部。