ImageButton automatic scaling issue
I'm trying to troubleshoot my code for开发者_JAVA技巧 a small form factor device and the ImageButtons I'm using in my RelativeLayout seem to get automatically scaled larger somehow. I've tried various methods of preventing them from scaling, but none of them have worked. Any suggestions?
I think you have to see Density Considerations for Preventing from Scaling.
The easiest way to avoid pre-scaling is to put the resource in a resource directory
with the nodpi configuration qualifier. For example:
res/drawable-nodpi/icon.png
When the system uses the icon.png bitmap from this folder, it does not scale it based on the current device density.
From http://developer.android.com/guide/practices/screens_support.html#DensityConsiderations
Try setting:
android:maxHeight
android:maxWidth
Can you tell us what methods you've tried so far?
精彩评论