I have an ImageButton like this one:
<ImageButton android:background="@drawable/ctg_a" android:layout_width="match_parent" android:layout_height="match_parent" android:adjustViewBounds="true" android:scaleType="centerCrop" android:id="@+id/cmdCategoryA" /> My layout has multiple of these ImageButtons inside a linearlayout (nested inside a scrollView). The Buttons should take 100% of the space available for their width, and use matching height so the ratio of the images (5:3) is not changed.
With my code, I get the image to fill the whole page in width, but in height the image uses its original size, which is too large and does not match the ratio.
So, currently, the image is something around 5:8 instead of 5:3. How do I reduce the height?
No comments:
Post a Comment