【问题标题】:How to style a Button element in Android UI?如何在 Android UI 中设置 Button 元素的样式?
【发布时间】:2016-08-17 19:24:05
【问题描述】:

我的按钮看起来像这样"

我怎样才能制作一个和这个一样的简单按钮

这是我的 xml 代码示例:

<Button
                android:layout_width="0dp"
                android:layout_height="wrap_content"
                android:layout_weight="1"
                android:text="MatchCenter"
                android:elevation="10dp"
                android:paddingBottom="5dp"
                android:layout_margin="10dp"
                android:drawableTop="@drawable/football"
                android:singleLine="true"
                android:background="@drawable/my_button"
                android:id="@+id/MatchCenter"
                android:textAllCaps="false"
                />

【问题讨论】:

  • 欢迎来到 StackOverflow,不幸的是,您的问题并未展示任何先前研究的尝试。为了获得良好的响应,建议您在提出问题之前展示您已尝试以代码或其他方式解决问题的证据。 StackOverflow 不是免费的代码生成器。如果您需要免费源代码,请在其他地方寻求帮助。
  • 换句话说,这个网站要求你在问你想要什么之前必须展示你已经尝试过的东西!
  • 我的第一张照片显示我正在尝试做类似的事情,我肯定会进行搜索但没有结果。
  • 您需要准确说明您要进行哪些更改。边境有问题吗?颜色怎么样 - 它们完全不同?对于关于 SO 的问题要获得良好的答复,您必须尽可能准确,这样我们就不必花费大量时间试图弄清楚这些问题并(可能)浪费时间在事情上你不在乎。

标签: android xml button


【解决方案1】:

【讨论】:

    猜你喜欢
    • 2020-10-17
    • 2013-04-27
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-05-15
    • 1970-01-01
    相关资源
    最近更新 更多