'ImageView of width larger than the screen width
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.
Solution 1:[1]
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"
Solution 2:[2]
There are couple of things you can do and it depends on the behavior you want to implement. A quick two solutions are:
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
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.
Solution 3:[3]
Try using scaleType in ur imageview xml,
android:scaleType="fitXY"
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | dumazy |
| Solution 2 | Community |
| Solution 3 | keshav |
