Android:缩放分辨率之间的图像偏移
我有一个应用程序,在横向模式下,我将一堆小写字母 ImageView png 排列起来,这样它们就位于一条假想线上。问题是它们的高度不同,即“h”比“a”高。因此,我一直在为每个字母设置 android:layout_marginTop 属性(以像素为单位),以便将它们排列在 Galaxy Tab 上。这已经奏效了。
我的问题是,当我在里程碑上运行应用程序时,偏移量的缩放有点不稳定。看起来好像发生了某种扩展,这确实有效,但并不完美。有人知道我该如何解决这个问题吗?
I have an app where, in landscape, I line up a bunch of lowercase alphabet ImageView pngs so that they are sitting on an imaginary line. The problem is that they are of different heights i.e. an 'h' is taller than an 'a'. Thus I've been setting the android:layout_marginTop attribute for each letter, in pixels, to line them up on the Galaxy Tab. This has worked.
My problem is that when I go to run the app on a Milestone, the scaling of the offsets is a litttttle wonky. It looks like there's some sort of scaling happening, which is kind of working, but it's not perfect. Anyone have an idea how I could remedy this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

发布评论
评论(2)
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
我认为尝试对每个字母和每个显示分辨率的偏移进行硬编码将是一个真正的痛苦,并且维护起来会更加痛苦。
一个简单的解决方案是使用 Photoshop(或 gimp)调整 png 文件的大小,使它们都具有完全相同的尺寸,并将 PNG 的新区域设置为透明。
I think that trying to hard code the offsets for each letter and each display resolution is going to be a real pain and will be even bigger pain to maintain.
An easy solution would be to use photoshop (or gimp) to resize the png files so they all have the exact same dimensions and set the new region of the PNG to be transparent.