0

我的布局中的按钮有问题。每当我添加一个按钮时,文本都会在按钮中心之后开始。

这就是我的意思:

在此处输入图像描述

我使用 aRelativelayout但我使用Linear,relativetable. 宽度和高度设置为 wrap_content。

我会非常感谢任何形式的帮助。

4

2 回答 2

1

试试这个 android:gravity="left"

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity" >

<Button
    android:id="@+id/button"
    android:layout_width="fill_parent"
    android:layout_height="200dp"
    android:gravity="left"
    android:text="Button" />

于 2012-12-23T11:28:48.867 回答
0

当我遇到这个问题时,它是 Eclipse GUI 设计器的问题。Eclipse 重启应该会有所帮助。

于 2014-07-08T17:58:06.720 回答