0

I am able to add background image ,and header image in xml file .But my problem is that how to add images on header (image over a another image), here is the picture ? which I want to implement. enter image description here

Rishabh Srivastava
  • 3,683
  • 2
  • 30
  • 58
user2648752
  • 2,123
  • 5
  • 21
  • 29

4 Answers4

0

For image over image, I would suggest you to Use FrameLayout.

Here are some links :

Link1

Link2

Community
  • 1
  • 1
hemantsb
  • 2,049
  • 2
  • 20
  • 29
0

If you want to make buttons with images on the header please consider using ActionBar. If what you really want is putting images on top of one another you may consider using LayerDrawable.

M.Sameer
  • 3,072
  • 1
  • 24
  • 37
0
Do this way..
<LinearLayout
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:background="@android:color/darker_gray"
        android:gravity="center" >

        <TextView
            android:id="@+id/txtHeader"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginLeft="10dp"
            android:text="header"
            android:textSize="15sp"
            android:textStyle="bold" />

        <View
            android:layout_width="0dp"
            android:layout_height="1dp"
            android:layout_weight="1" />

        <ImageView
            android:layout_width="45dp"
            android:layout_height="35dp"
            android:layout_marginRight="10dp"
            android:scaleType="fitXY"
            android:src="@drawable/ic_launcher" />

        <ImageView
            android:layout_width="45dp"
            android:layout_height="35dp"
            android:layout_marginRight="10dp"
            android:scaleType="fitXY"
            android:src="@drawable/ic_launcher" />

        <ImageView
            android:layout_width="45dp"
            android:layout_height="35dp"
            android:layout_marginRight="10dp"
            android:scaleType="fitXY"
            android:src="@drawable/ic_launcher" />
    </LinearLayout>
Brijesh Patel
  • 676
  • 1
  • 5
  • 13
0

Take a layout for example RelativeLayout put the sky blue colour as its background(shown in your figure). Then take a TextView on its extreme left and the three buttons on the extreme right side. See the sample code am posting.

 <RelativeLayout 
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:background="#7A8B8B"
        android:gravity="center" >

        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_alignParentLeft="true"
            android:text="My Cases"
            android:textColor="#000000"
            android:gravity="center_vertical" />

        <LinearLayout
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_alignParentRight="true"
            android:orientation="horizontal" >

            <Button
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="btn1" />

            <Button
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="btn2" />

            <Button
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="btn3" />
        </LinearLayout>

    </RelativeLayout>
Rishabh Srivastava
  • 3,683
  • 2
  • 30
  • 58