I have a relative layout with some ImageViews that sometimes extend beyond the layout's boundaries. When this happens the ImageViews get resized so they become smaller instead of extend out of bounds. I want them to display normally and just get cropped.
I think there is some kind of boolean to do that, but I can't find it in the API. I thought it might be clipChildren under ViewGroups, but setting that to false or true seems to do nothing. Anyone help is appreciated.
Bookmark this question.
Tap the image you want to adjust. You can adjust the size of an image or rotate it: Resize: Touch and drag the squares along the edges. Rotate: Touch and drag the circle attached to the image.
A little bit late but have you tried this code in your xml?
<ImageView
android:scaleType="centerCrop"
android:id="@+id/imageView"
android:layout_width="fill_parent"
android:layout_height="fill_parent" />
The key is in scaleType. It keeps the aspect ratio of your image cropping it to the bounds of layout.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With