How to create background for LinearLayout as shown in the image below

Create a RelativeLayout with a background of the yellow color and add the circle image on top.

This is a far more dynamic solution than using a single image as the RelativeLayout will change size depending on screen size/orientation and not affect the sizing of the circle

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:background="#ffc20e">

    <ImageView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentTop="true"
        android:layout_centerHorizontal="true"
        android:background="@drawable/circle_image" />

</RelativeLayout>

Leave a Comment