在我的应用程序中,我已经显示了两个按钮。其中的文字如下所示。我怎样才能从同一行(中心)对齐两个文本。如何将中心的按钮文字对齐
因此很显然,我要开始按钮文本 “Amiyo” & “Amiyo比斯瓦斯” 从同一行(中心)
这里是我的XML:
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="0dip"
android:layout_weight=".75"
android:orientation="vertical"
android:layout_marginTop="15dp"
>
<Button
android:layout_width="fill_parent"
android:layout_height="0dp"
android:layout_weight=".10"
android:text="Amiyo"
android:gravity="center"
android:textAlignment="gravity"
/>
<Button
android:layout_width="fill_parent"
android:layout_height="0dp"
android:layout_weight=".10"
android:text="Amiyo Biswas"
android:gravity="center_horizontal|center_vertical"
android:textAlignment="gravity"
/>
</LinearLayout>
我想like this alignment
他们在中心。由于文本长度有所不同。 – 2014-10-22 09:34:09
是的。我明白 。有什么办法可以解决这个问题吗? – 2014-10-22 09:34:53
解决什么问题?没有什么可解决的。 – 2014-10-22 09:38:04