Android按钮设计

huangapple go评论73阅读模式
英文:

Android button design

问题

如何在Android中制作一个如下图所示的按钮:

Android按钮设计

英文:

How can i make a button in android as shown in the image below

<img src="https://lh5.googleusercontent.com/T9NAwNKMOzK4WaZhcEFSnaEo4OJQ0EgECli9R1cvEpkUFGAghGAP26dlS1j3doUPm1DLU7cBosZYMwduVwnf" width="400"/>

答案1

得分: 2

全文参考 fornewid/neumorphism:

implementation 'com.github.fornewid:neumorphism:0.2.0' 添加到您的 Gradle 中

我创建了一个类似的按钮

<soup.neumorphism.NeumorphButton
    android:id="@+id/button"
    style="@style/Widget.Neumorph.Button"
    android:layout_width="200dp"
    android:layout_height="80dp"
    android:layout_centerHorizontal="true"
    android:layout_centerVertical="true"
    android:text="继续"
    android:textAllCaps="false"
    android:textColor="@android:color/white"
    android:textSize="20sp"
    android:textStyle="bold"
    app:layout_constraintBottom_toBottomOf="parent"
    app:layout_constraintEnd_toEndOf="parent"
    app:layout_constraintStart_toStartOf="parent"
    app:neumorph_shadowColorDark="#191a1c"
    app:neumorph_shadowColorLight="#323639"
    app:neumorph_shadowElevation="6dp" />

预览:

Android按钮设计

英文:

Full credit to fornewid/neumorphism :

Add implementation &#39;com.github.fornewid:neumorphism:0.2.0&#39; to your Gradle

I've created a similar button

 &lt;soup.neumorphism.NeumorphButton
        android:id=&quot;@+id/button&quot;
        style=&quot;@style/Widget.Neumorph.Button&quot;
        android:layout_width=&quot;200dp&quot;
        android:layout_height=&quot;80dp&quot;
        android:layout_centerHorizontal=&quot;true&quot;
        android:layout_centerVertical=&quot;true&quot;
        android:text=&quot;Continue&quot;
        android:textAllCaps=&quot;false&quot;
        android:textColor=&quot;@android:color/white&quot;
        android:textSize=&quot;20sp&quot;
        android:textStyle=&quot;bold&quot;
        app:layout_constraintBottom_toBottomOf=&quot;parent&quot;
        app:layout_constraintEnd_toEndOf=&quot;parent&quot;
        app:layout_constraintStart_toStartOf=&quot;parent&quot;
        app:neumorph_shadowColorDark=&quot;#191a1c&quot;
        app:neumorph_shadowColorLight=&quot;#323639&quot;
        app:neumorph_shadowElevation=&quot;6dp&quot; /&gt;

Preview :

<img src="https://i.stack.imgur.com/hygQP.png" width="400"/>

huangapple
  • 本文由 发表于 2020年9月8日 04:17:45
  • 转载请务必保留本文链接:https://go.coder-hub.com/63783723.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定