I have a layout(with a background image) containing an imageview and few Textviews. Initially, I want to show half of the image for ImageView which matches its height with layout background. Later, at runtime when the user clicks on the layout, the layout should expand with animation showing the ImageView full.
Asked
Active
Viewed 220 times
2 Answers
1
Divide your layout into sub layouts and use Visibility of views.. By default make your undesired layout invisible and after you click something make Visible all of your layout.
-
definitely I can do this. But the problem I am facing is, how to show only part of the ImageView initally ? – Manjunath Oct 01 '12 at 07:27
-
Place your image in a relative layout, Add some background matching view over it, and at run time hide the visibility of overlapping view. i guess this will solve the purpose. – Oct 01 '12 at 07:29
-
Hmm See in relative layout you can place another view on top of each other using align_parent_top property..What i am suggesting is initially place your another layout on top of Imageview and hide this at run time. Still not understood post your xml – Oct 01 '12 at 07:43
0
I got the answer:
I just used android:android:scaleType="matrix"
to display only half of the image in ImageView, but I should hardcode the height of the ImageView.

Manjunath
- 2,063
- 2
- 29
- 60