How to make an Imageview overlap the screen - android

I'm stacking ImageView's on eachother from bottom to top (by layout_above), but what I want to make the top one overflow/overlaps the screen. Normally this would resize/crop the imageview to make it fit in the screen, but I want to to be like in the picture shown below.
How would I be able to achieve this?

Related

android imageview auto scaled without overlap other view

I have a linear layout(mLL) that fit the whole screen.
Within it, there are 3 things.
That is a textview contains a mulit line string.
It is followed by a imageview. The imageview fit the remain area of screen (problem here).
That I added a horizontal menubar (radiogroup with some image buttons) and aligned it to the bottom of linear layout(mLL).
The result is the radiogroup button show on top of the image.
What I hope is, the imageview fit itself to occupied the whole screen, but left sufficient space for textview and a horizontal radiogroup button.
I know I can use program code to scale the image, but I wonder if there are some attributes or correct xml layout that can intuitively create above arrangement? I mean, the arrangement of some text, followed by picture, and then a menubar is so common that should have a better way to implement it.
P.S. I tried to add the menubar before the imageview. Consequently, the imageview shows on top of menubar, i.e. menubar is partially hidden.
P.S2. The menubar need to tough the bottom of screen. So, it should be added to relative to mLL.

Move an element in relative layout to absolute edge of the screen

Is it possible to move a button or any other element in relative layout to the absolute edge of the sreen? If I drag a certain element to the edge of the layout, eclipse will automatically place it a few dp away from the edge. It'll basically just create a small space between a button and the end of the creen. Is it possible to bypass that?
I know buttons aren't meant to be that close to the edge of the screen anyway, but I need it for a certain thing.
The normal button has a little padding by default, because the buttons backgroundimage is a 9-patch image with padding left, right and on bottom. That's why you see the space between button and screen.
To solve this you can use a custom button. For example change the backgroundimage of button like this android:background="#drawable/image".

It is possible to use ScaleType CENTER_CROP but without centering the image vertically? (showing the top of the image)

I'm displaying a imageview with a bitmap. The imageview initially shows some blank spaces in left and right of the bitmap, so i used CENTER_CROP to solve that. The problem is that now the bitmap is centered vertically and the top of the image can't be visible, and i dont want that. I want that the image top must be displayed, i don't care about the bottom.
It is possible to achieve that?
Have you tried setting the paddingTop to image.I hope by setting paddingTop to the image view you can push the top of the content downward. Sometimes at bottom it will miss something but still you will be able to see the top of the image.

overlay imageview without pushing layouts down

a picture is worth a thousand words, so my question should basically be self-explanatory with the attached image: How to get rightmost screen instead of the center screen?
turns out i cannot attach images directly yet, so i have to link to it right now:
How to get rightmost screen instead of the center screen?
just to add, i realise that it is not really possible to have the framelayout NOT expand as shown in screen 2b, but my question remains as to how to achieve such an overlay without pushing the Other layouts down i.e. the bottom part of the imageview would be on top of the top right part of the other layouts
perhaps you could have the image you are dynamically adding be outside the frame layout. ie have a relative layout contain both framelayouts and the imageview – jkhouw1 1 hour ago

Android slide animation problem

I have a 3 horizontal views - an image on the left which is a thin vertical handle-type bar and an image to its right followed by a textview. What I'm trying to achieve is a sliding animation, activated with a click on the handle, so that the center image slides in and out to the left (and so disappearing when fully left) with the textview following this animation smoothly. The effect will be the handle remains in place (hence I can't use the SlidingDrawer), the image comes and goes and the textview is always present but slides into the space where the image went. Its just collapsing the image really.
The problem is if I apply android.R.anim.slide_in_left/android.R.anim.slide_out_left to the image and the textview simultaneously I see they slide completely to the left edge of the screen, temporarily overwriting the handle. Is there a way to still animate but not go all the way to the screen edge?

Categories

Resources