ImageButtons/ImageViews 和图形在我的应用程序上自行调整大小

发布于 2024-10-05 00:17:58 字数 289 浏览 0 评论 0原文

我编译了我的应用程序,然后重新运行它,突然间我的图形都调整到了更小的版本......无论是 ImageViews,ImageButtons 等......

我确实在 ldpi 中放置了一个小图标,一个中等大小的图标mdpi 中的一个和 hdpi 中的一个高的 - 这可能是引发问题的原因吗?我没有更改我的代码,因此我用作布局标题的所有 ImageView 仍设置为 wrap_content,所有内容都变得更小。

知道为什么会这样,或者有解决方法吗?

顺便说一句,我在 Motorola Droid 2 上进行了测试

I compiled my application, and then reran it, and all of a sudden my graphics have all resized to much smaller versions of themselves...be it ImageViews, ImageButtons, etc...

I did place a small icon in ldpi, a medium one in mdpi and a high one in hdpi - could that be what triggered the issue? I didn't change my code, so all of my ImageViews I am using as titles for layouts are still set to wrap_content, everything just got smaller.

Any idea why this may be, or are there workarounds?

I test on a Motorola Droid 2, btw

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

羅雙樹 2024-10-12 00:17:59

当您刚刚在 res/drawable 中工作时,Android 会自动缩放资源。

添加新资源时,您是否将现有资源放入 res/drawable-mdpi 中,然后将 150% 大小的资源放入 res/drawable-hdpi 中,然后将其放入 res/drawable-hdpi 中75% 在 res/drawable-ldpi 中?

或者您是否将现有资源放入 res/drawable-hdpi 中,然后将两个较小的版本放入 res/drawable-mdpires/drawable-ldpi 中>?如果你这样做了,那么你的图形就会显得缩小。

When you were just working in res/drawable android automatically does the scaling of the asset.

When you added the new assets did you put your existing asset in res/drawable-mdpi and then one that is 150% size in res/drawable-hdpi and one that is 75% in res/drawable-ldpi?

Or did you put your existing asset in res/drawable-hdpi and then two smaller versions in res/drawable-mdpi and res/drawable-ldpi? If you did then your graphics would have appeared to shrink.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文