gpt4 book ai didi

java - 圆角按钮不起作用

转载 作者:行者123 更新时间:2023-12-01 11:33:45 24 4
gpt4 key购买 nike

我从服务器获取颜色代码 #3a87ad 设置为背景,并且我还尝试为我的按钮提供圆角形状。但是它始终显示黑色作为背景。

tv_img_tag = (Button) vi.findViewById(R.id.tv_img_tag);

tv_img_tag.setBackgroundColor(Color.parseColor(product
.get("stop_status_color")));

tv_img_tag.setBackgroundResource(R.drawable.roundedtexts);

tv_img_tag.setText(product.get("stop_status_name").toString());

roundedtexts.xml

<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle"
>


<corners
android:bottomLeftRadius="8dp"
android:bottomRightRadius="8dp"
android:topLeftRadius="8dp"
android:topRightRadius="8dp" />
<padding

android:left="8dp"
android:top="8dp"
android:right="8dp"
android:bottom="8dp" />
</shape>

最佳答案

嗨,兄弟,试试这个工具,创建精彩的 Android 按钮。工具还为您提供源代码。 Angry Tools

关于java - 圆角按钮不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30207729/

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