gpt4 book ai didi

android - Android 中按钮的边框

转载 作者:太空宇宙 更新时间:2023-11-03 11:27:18 24 4
gpt4 key购买 nike

我制作的页面与下面给出的图片链接完全一样但我不知道如何实现按钮的金色边框开始,请帮助谢谢

链接- http://cdn9.staztic.com/app/a/2256/2256036/muthoot-fincorp-my-jewel-box-4103-0-s-307x512.jpg

最佳答案

像这样在你的 drawable 文件夹中创建一个 drawable shape,

<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<gradient android:startColor="#FFFFFF"
android:endColor="#FFFFFF"
android:angle="270" />
<corners android:radius="3dp" />
<stroke android:width="5px" android:color="#eecc68" />
</shape>

在你的 .xml 中,如下所示,

<Button
android:id="@+id/button1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="@+id/textView1"
android:layout_below="@+id/textView1"
android:layout_marginLeft="52dp"
android:layout_marginTop="39dp"
android:background="@drawable/button"
android:text="Button" />

关于android - Android 中按钮的边框,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18955617/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com