Although you've specified the ImageView's width to match_parent
, the height is fixed to 200dp. This means if the image ratio is restricted to the height in respect to its container, the image will be horizontally padded to maintain the aspect ratio.
There are different ways to solve your problem:
- Set the ImageView's scaleType to
fitXY
to allow the image to stretch regardless of its aspect ratio. - Set the ImageView's height to
wrap_content
to allow the height to be determined dynamically. Beware that the ViewPager's height should cope with this, for instance by being set tomatch_parent
. - Allow pages of the ViewPager to overlap.