Android ,overlapping imageview android
NickName:exploreR Ask DateTime:2015-03-08T13:01:40

Android ,overlapping imageview android

I tried to display a small imageview above the big imageview .It worked fine. But when I made the small imageview to appear in rounded shape, It is not showing up.. Your reply will be helpful

there is no error or warning or any crashing of avd .simply the small imageview is not showing

.xml file:

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:orientation="vertical" >



    <ImageView
        android:id="@+id/imageView1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentTop="true"
        android:adjustViewBounds="true"
        android:maxHeight="1000dp"
        android:maxWidth="1000dp"
        android:scaleType="fitXY"
        android:src="@drawable/ciaz"
        tools:ignore="ContentDescription" />

    <ImageView
        android:id="@+id/imageView2"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignBottom="@+id/imageView1"
        android:layout_centerHorizontal="true"
        android:layout_marginBottom="14dp"
        android:adjustViewBounds="true"
        android:maxHeight="300dp"
        android:maxWidth="300dp"
        android:scaleType="fitXY"
        android:src="@drawable/ac"
        android:visibility="visible"
        tools:ignore="ContentDescription,RtlHardcoded" />
</RelativeLayout>

mainactivity.java

protected void onCreate(Bundle savedInstanceState) 
    {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        im1 = (ImageView) findViewById(R.id.imageView1);
        im2 = (ImageView) findViewById(R.id.imageView2);



        im1.setOnTouchListener(new OnTouchListener() {

            @Override
            public boolean onTouch(View arg0, MotionEvent arg1) {
            try
            {
                int action=arg1.getAction();
                float x=(float)arg1.getX();
                float y=(float)arg1.getY();


                if(action==MotionEvent.ACTION_DOWN)
                {
                    context = getApplicationContext();
                    duration = Toast.LENGTH_SHORT;
                    String g= x+"  "+y;


                    Toast toast = Toast.makeText(context, g, duration);
                    toast.show();

                    if((x>0.0) && (x<100)&&(y>0.0) && (y<100))
                    {
                        im2.setVisibility(View.VISIBLE);
                        Bitmap bm = BitmapFactory.decodeResource(getResources(),R.drawable.ac);
                        roundedImage = new RoundedImageView(bm);
                        im2.setImageDrawable(roundedImage);
                  }


                }

                }

            catch(Exception e)
            {
                Toast toast = Toast.makeText(context, "exception", duration);
                toast.show();
            }
            return false;
            }
        });


    }

enter code here

Copyright Notice:Content Author:「exploreR」,Reproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/28923270/android-overlapping-imageview-android

More about “Android ,overlapping imageview android” related questions

Overlapping Admob ads on ImageView in android

I have used the following in android xml. Whenever I'm scrolling the page the admob ad is overlapping the some part of Image from bottom. &lt;RelativeLayout xmlns:android="http://schemas.android.c...

Show Detail

Android ,overlapping imageview android

I tried to display a small imageview above the big imageview .It worked fine. But when I made the small imageview to appear in rounded shape, It is not showing up.. Your reply will be helpful ther...

Show Detail

How to prevent imageview overlapping in android

i wanna put multiple imageview in a row like this http://imgur.com/wYpAgxE but there is some bugs, the imageview are overlap on top of each other, i want to place them side by side with each oth...

Show Detail

Overlapping Views in Android

Is it possible to have overlapping views in Android? I would like to have an ImageView with a transparent png in the front and another view in the background. edit: This is what I have at the mom...

Show Detail

Overlapping ImageView in RelativeView

As my code below shows, I've two ImageView that I would like to overlap but the bigger is systematically put below the smaller one, both is android:layout_alignParentTop set "true", I thought that ...

Show Detail

Image animation not overlapping in android

I have a layout like &lt;ImageView android:id="@+id/slide_image" android:layout_width="match_parent" android:layout_height="wrap_content" android:src="@

Show Detail

Android LinearLayout overlapping imageView

I am trying to use a cardview to have an imageview and to the right of it a linearlayout, the problem i am having is the linearlayout is getting drawn on top of my imageview. I am using a listview...

Show Detail

Constraint Layout - Android - Avoid Overlapping

I have an issue with constraint Layout overlapping. Basically, I have an image on the left and text view on the right. I am trying to have the text in the text view to appear in the centre of the s...

Show Detail

Android: swapping two overlapping views

Can anyone tell me what's wrong with this implementation? All I want to do here is have two overlapping views that swap places when you tap the screen. Unless I'm just using it wrong, View.bringT...

Show Detail

Android: ImageView with TextView at the bottom

I am trying to place an image with a label below the image, I have been trying a lot but couldn't prevent the image and text from overlapping, Here is my layout.xml &lt;RelativeLayout xmlns:android="

Show Detail