3

I m trying to create a layout where there is image which is in background and another image which i m tring put on above of the background image,but the issue is i want to place second image above first one without loosing quality of second image .Now it is bit blur as below in 3rd image:

Here is my 2 Images :

Image 1: enter image description here

Image 2:

enter image description here

It looks this way :

enter image description here

third image is getting bit blur.. is it possible to make more clear image as result .

My Layout :

<RelativeLayout 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="@drawable/image1"
    android:paddingBottom="@dimen/activity_vertical_margin"
    android:paddingLeft="@dimen/activity_horizontal_margin"
    android:paddingRight="@dimen/activity_horizontal_margin"
    android:paddingTop="@dimen/activity_vertical_margin" >

    <Button
        android:id="@+id/intentskip"
        android:layout_width="500dp"
        android:layout_height="200dp"
        android:layout_alignParentBottom="true"
        android:layout_alignRight="@+id/imageView1"
        android:background="@drawable/blank"
        android:visibility="visible" />

    <ImageView
        android:id="@+id/image2"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:layout_alignParentLeft="true"
        android:src="@drawable/frames_01521" />

</RelativeLayout>
KOTIOS
  • 11,177
  • 3
  • 39
  • 66

3 Answers3

5

Try to use a FrameLayout such as following:

<FrameLayout
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_gravity="center_vertical"
    android:focusable="false" >

    <ImageView
        android:id="@+id/img_first"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_gravity="center_vertical"
    />

    <ImageView
        android:id="@+id/img_second"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_gravity="center_vertical"
    />
</FrameLayout>

Read more and even more about FrameLayout and you will love it.

J Jiang
  • 1,452
  • 10
  • 14
2
<ImageView
        android:id="@+id/image2"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:layout_alignParentLeft="true"
        android:gravity="center_horizontal|center_vertical"
        android:scaleType="fitCenter"
        android:background="@drawable/background_or_image_bottom"
        android:src="@drawable/frames_01521" />

Or you can use FrameLayout

Placing/Overlapping

Community
  • 1
  • 1
Luc
  • 2,800
  • 2
  • 25
  • 46
1

Try using FrameLayout or Fragments. As far I understood it will solve your problem.

Saggy
  • 624
  • 8
  • 23