Search code examples
androidanimationlayout-animation

Expand layout at runtime


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.


Solution

  • 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.