2011-08-01 27 views
4

在我的Android应用程序中,我有一个用于投票照片的按钮。当用户选择此按钮时,此按钮上的文本变成“感谢您的投票”,当他看到他投票之前的照片时,按钮上将显示文本“您已经为此照片投票”......问题是它看起来像这样:http://i55.tinypic.com/t4z3vl.png如何适合按钮上的文字?

任何人都可以帮我热我可以适应按钮上的文字?

任何想法是值得欢迎的。提前致谢。

在XML中我有这样的:

<LinearLayout android:layout_width="fill_parent" 
     android:layout_height="wrap_content" android:layout_below="@id/imagetitle" 
     android:orientation="horizontal"> 
     <Button android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:text="Previous" android:id="@+id/previous" /> 
     <Button android:layout_width="185dip" android:layout_height="wrap_content" 
      android:text="Vote for this picture" android:id="@+id/vote" /> 
     <Button android:layout_width="wrap_content" 
      android:layout_height="wrap_content" android:text="Next" android:id="@+id/next" /> 
    </LinearLayout> 
+0

你想要做什么加入这一行的布局?让它占用更多的空间?或剪辑文本? –

+0

我希望投票的按钮与按钮Next和Previous ...处于同一级别和同一行上,并且要在按钮 – Gabrielle

+0

上清除所有文本,以便第二个按钮直接使用** android:width ** android:layout_width =“wrap_content” – Hanry

回答

5

我认为要对齐所有按钮 顶部

LinearLayout android:baselineAligned="false" 
+0

如果我有这个:http://i52.tinypic.com/ifa987.jpg我得到这个:http://i53.tinypic.com/2wbt121.png所以,这是更好,但不是好的 – Gabrielle

+0

@Gabrielle分配布局重量给他们可能会帮助你 –

+0

你是对的..它的作品:D ...谢谢 – Gabrielle

3

使用"wrap_content"Button

+0

我有layout_height的wrap_content – Gabrielle

+0

向我们展示你的xml! –

+0

我用我的xml编辑了我的问题。 – Gabrielle