我的布局中的按钮有问题。每当我添加一个按钮时,文本都会在按钮中心之后开始。
这就是我的意思:
我使用 aRelativelayout
但我使用Linear
,relative
或table
. 宽度和高度设置为 wrap_content。
我会非常感谢任何形式的帮助。
试试这个 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" />
当我遇到这个问题时,它是 Eclipse GUI 设计器的问题。Eclipse 重启应该会有所帮助。