android - 如何在按钮上调整文字?

标签 android button text

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

任何人都可以帮助我,我可以将文字放在 Button 上吗?

欢迎任何想法。提前致谢。

在 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>

最佳答案

我想你想对齐所有按钮的顶部 在你的布局中添加这一行

LinearLayout android:baselineAligned="false"

关于android - 如何在按钮上调整文字?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6897878/

相关文章:

file - 如何计算两个license.txt文件之间的相似度?

java - 如何获取二维数组中的单词和行列表?

swift - 如何从选定的表格 View 单元格中检索文本?

android - 具有相等行高的表格布局

android - 错误 :(22, 25) 不允许整数类型(在 'black' 处,值为 '000000')。在 Android 的 values.xml 文件中

android - 为每个按钮启用触摸反馈

html - 按钮的可点击区域太小

javascript - 表单内未捕获的 TypeError : object is not a function, 按钮

Android SearchView X 标记图标

android - 如何使 Firebase 邀请在模拟器上工作?