Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community!
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.Start your free trial
android:adjustViewBounds="true" not working
Hi, at the android tutorial Implementing Designs for Android->Customizing a GridView for Friends->Adding Images to the GridView the android:adjustViewBounds="true" is not working. I try to download the source file and pull into Eclipse but the results is still the same.
I think the issue is because of the drawable resource avatar_empty.png which are included in the Ribbit Assets zip file downloaded earlier. All resources are suitably re-sized as per the different screen sizes - mdpi, hdpi, xhdpi and so on. However, the 'adjustViewBounds' attribute requires images to be of a certain size or more to work (204 px or above in height ~ xxhdpi). This is because the 'adjustViewBounds' will not increase the size of the ImageView beyond the natural dimensions of the drawable. It will only shrink the view to maintain aspect ratio.
Therefore the solution is : Replace the avatar_empty.png in each of the drawable folders less than xxhdpi standards with the avatar_empty.png in the drawable-xxhdpi folder.