【问题标题】:How to do these android buttons如何做这些android按钮
【发布时间】:2017-10-28 20:40:25
【问题描述】:

我从材质布局开始,想知道如何制作这个按钮。尤其是两者之间的细线

enter image description here

谢谢

【问题讨论】:

  • AppCompat 并使用 Widget.AppCompat.Button.Borderless(.Colored) 创建一个按钮主题,并将其设计为您在 styles.xml 中想要的任何内容
  • 如果我将无边框按钮并排放置会锻炼吗?
  • 我不明白

标签: android button layout


【解决方案1】:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">

<Button
    style="@style/Base.Widget.AppCompat.Button.Borderless"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_weight="1"
    android:background="@null"
    android:text="Criar Contan"
    android:textAllCaps="true" />

<View
    android:layout_width="1dp"
    android:layout_height="match_parent"
    android:layout_marginBottom="16dp"
    android:layout_marginTop="16dp"
    android:background="@color/background_grey" />

<Button
    style="@style/Base.Widget.AppCompat.Button.Borderless"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_weight="1"
    android:text="Entrar"
    android:textAllCaps="true" />

【讨论】:

  • 有点锻炼,但按钮失去了点击动画
  • 只需将 android:foreground="?android:attr/selectableItemBackground" 添加到每个按钮
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2020-04-11
  • 2013-01-18
  • 2019-09-22
  • 2021-04-05
  • 1970-01-01
相关资源
最近更新 更多