Android按钮文本在按钮中心后启动

时间:2012-12-23 11:16:10

标签: android button text center

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

这就是我的意思:

enter image description here

我正在使用Relativelayout,但如果我使用Linearrelativetable则无关紧要。 width和height设置为wrap_content。

我非常感谢任何帮助。

2 个答案:

答案 0 :(得分: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" />

答案 1 :(得分:0)

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