【问题标题】:Textview: adjust font size to match parent [duplicate]Textview:调整字体大小以匹配父级[重复]
【发布时间】:2014-08-29 07:59:19
【问题描述】:

是否可以将字体大小设置为自动match_parent

我的TextView 已经是width/height="match_parent",但字体很小,不适合父大小。

怎么做?

【问题讨论】:

标签: android user-interface


【解决方案1】:
android:autoSizeTextType="uniform"

将此行添加到您的TextView

编辑: 此行适用于 api 26 及更高版本,因此如果您想将其用于低于 26 的 api,请使用此

app:autoSizeTextType="uniform"

如果添加此行给您错误,请通过添加忽略错误

tools:ignore="MissingPrefix"

【讨论】:

    猜你喜欢
    • 2012-09-13
    • 2011-06-16
    • 1970-01-01
    • 2011-02-06
    • 1970-01-01
    • 2012-11-01
    • 1970-01-01
    • 2011-12-11
    相关资源
    最近更新 更多