ImageButton自动缩放问题
我正在尝试对小型设备的代码进行故障排除,而我在relativelayout中使用的imagebuttons似乎会以某种方式自动缩放。我尝试了各种方法来防止它们扩展,但没有一个有效。有什么建议吗?
I'm trying to troubleshoot my code for 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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我认为您必须了解防止结垢的密度注意事项。
避免预缩放的最简单方法是使用 nodpi 配置限定符
将资源放入资源目录
。例如:当系统使用此文件夹中的 icon.png 位图时,它不会根据当前设备密度对其进行缩放。
从
http://developer.android.com/guide/practices/screens_support.html#DensityConsiderations
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: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:
Can you tell us what methods you've tried so far?