根据可用房间自行调整文字大小

时间:2012-02-03 15:22:06

标签: java android android-layout textview

我正在尝试执行以下操作:

给定最大尺寸(例如400x400)。制作尺寸不同的文字以填充空间。例如,如果所需的文本是“A”,它将具有高textSize值,但是如果我放一个长句子,则应减少textSize以适应大小。

可以轻松实现吗?感谢

2 个答案:

答案 0 :(得分:1)

取决于您的经验水平。 “轻松”是主观的。那里有implementations提供了不错的起点。

答案 1 :(得分:1)

Give the textview fill_parent hight and width so that as you type e.g ASDF then it will automatically reduce size and if only "A" then it will show max hight and widht.
This textview will set in layout which hight and width you will set as you want like 400*400.
If any double catch me..
最佳

V.k