5
votes

I'm implementing an animation which displays scrolling image. I need to display a image in its original size even if the width is more than the screen width and then have to animate it. Please tell me how to place image like that.

3
Trued almost all the XML properties, but It always clips or fits to screen width.Mr.Rao

3 Answers

1
votes

Check out the different scaletypes here: http://bon-app-etit.blogspot.be/2014/01/imageview-scaletypes.html

I think you'll need android:scaleType="centerCrop"

0
votes

There are couple of things you can do and it depends on the behavior you want to implement. A quick two solutions are:

  1. You can use ScrollView with your image in it and by touching it you can move it left or right. Example solution you can find here: Displaying an image larger than the device's screen

  2. You can use absolute layout (although this layout is already deprecated) and place your image in it. Make the layout width and height be the same as your image.

The animation can be done with many ways:
1. On touche event handling
2. Fling with scroller or gesture detector
3. Accelerometer tilt

Hope it directs you to the right solution.

-1
votes

Try using scaleType in ur imageview xml,

  android:scaleType="fitXY"