Android的文字位置 [英] Android Text Placement

查看:166
本文介绍了Android的文字位置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是比较新的Andr​​oid开发,并正在开发与背景图像的应用程序。我需要有可靠的文字放在pcisely相对于某些点的背景图像上的能力和$ P $。我开发了一个Droid的收费应用程序的调试。一切都看起来不错那里。不过,我下载的应用程序到Droid X的,而文字是有点过。我想我错过关于Android开发的一些基本的了解,并且将AP preciate任何帮助。另外,我相信这个人有类似的问题。

I am relatively new to Android development, and am developing an application with an image for a background. I need the ability to have text reliably and precisely placed in relation to certain points on the background image. I developed the application debugging on a Droid Charge. Everything looks fine there. However, I downloaded the application to a Droid X, and the text is a little off. I imagine I am missing some fundamental understanding about Android development, and would appreciate any help. Also, I believe this person is having a similar problem.

<一个href=\"http://stackoverflow.com/questions/6534337/screen-sizes-and-$p$pcise-element-placement-on-android\">Screen大小和precise元素放置在Android

推荐答案

那么你需要了解的是,由于支持多屏幕,这不是明智的,有一定的点或坐标绘制的意见。如果你想根据背景的位置绘制文本,那么可能是你应该使用自定义视图在背景图片可以作为您的自定义视图的后台工作,然后你可以放置文本确切位置。结果
另一个想法是使用 9补丁绘制这是不拉伸(背景采用9补丁绘制绵延上改变视图的大小)。然而,你必须提供针对不同屏幕密度不同的绘制即可。我会选择第一个选项,因为它更容易。结果
PS:请告诉我在评论,如果你发现在应用选项中的任何任何困难

Well you need to understand that due to support of multiple screen, it's not wise to have a certain points or coordinates to draw your Views. If you want to draw a text according to a background position, then may be you should use a custom View where the background picture can work as the Background of your custom view and then you can place the text at the exact location.
Another idea would be to use a 9 patch drawable which is not stretchable (Background uses 9 patch drawable which stretches on changing the size of the view). However you have to supply different drawable for different screen densities then. I'd choose the first option, as it's easier.
PS: Tell me in comment, if you find any difficulty on applying any of the option.

这篇关于Android的文字位置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆