xml - 如何在strings.xml中居中字符串?
问题描述
我有一个文本字符串,我想在我的应用程序中居中。这是strings.xml
这样的:
<resources>
<string name="app_name"><font size="28" fgcolor='#444444'><b>Test</b></font></string>
</resources>
我怎样才能使这个文本居中?目前它在应用程序的 header中左对齐。
这是使用字符串的地方(in AndroidManifest.xml
):
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/Theme.Blue">
我试过android:gravity="center"
了,但这似乎只适用于 TextViews... 这不是 TextView,这是应用程序的标题栏。
解决方案
推荐阅读
- javascript - 使用 R 在 Highcharter 中添加标志
- c# - 在 Visual Studio 的 AWS Toolkit 中调用 Alexa Skill 示例请求时出现 JSON 错误
- macos - 如何在 macOS 上为文档获取图标?
- javascript - JQuery SlideUp/SlideDown 有问题并再次自行重置
- html - 如何在表单域之间添加空格
- arrays - 查询结果 Google 表格中的 VLookup 列
- kubernetes - helm 卸载成功但不删除 pod
- vba - 参数太少,预期为 1
- botframework - Bot 框架作曲家环境变量
- intellij-idea - IntelliJ lombok 注释不刷新