开发者

ImageButton automatic scaling issue

开发者 https://www.devze.com 2023-03-16 09:49 出处:网络
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 vario

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?

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号