【问题标题】:Self-adjusting text size depending on the available room根据可用房间自动调整文本大小
【发布时间】:2012-02-04 00:16:16
【问题描述】:

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

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

可以轻松实现吗?谢谢

【问题讨论】:

    标签: java android android-layout textview


    【解决方案1】:

    取决于您的经验水平。 “容易”是主观的。 implementations 提供了不错的起点。

    【讨论】:

      【解决方案2】:
      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

      【讨论】:

        猜你喜欢
        • 2014-05-04
        • 2013-04-09
        • 1970-01-01
        • 2013-10-09
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2012-05-31
        相关资源
        最近更新 更多