【问题标题】:Android ADT aligning text in buttonAndroid ADT 对齐按钮中的文本
【发布时间】:2013-10-20 10:31:40
【问题描述】:

这是 xml 标签:

<Button
    android:id="@+id/button1"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_below="@+id/textBox"
    android:layout_centerHorizontal="true"
    android:layout_marginTop="84dp"
    android:text="@string/Button" />

它应该是“按钮”而不是“但是”...

那么问题出在哪里?

【问题讨论】:

  • 检查strings.xml中的字符串Button是否不是But
  • 你试过运行这段代码吗?因为有时它会显示文本 righalign 但在模拟器或设备上它会在中心显示文本。

标签: android android-layout button alignment


【解决方案1】:

我前段时间遇到过类似的问题,从Graphical Layout 切换到不同的Android api 级别 似乎解决了这个问题。

【讨论】:

    【解决方案2】:

    只需输入 android:text="Button" 或在 string.xml 中输入您的文本

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2011-04-07
      • 1970-01-01
      • 2012-07-05
      • 2021-12-26
      • 1970-01-01
      • 2017-03-17
      • 2020-10-05
      相关资源
      最近更新 更多