gpt4 book ai didi

Android:listview角落的背景

转载 作者:行者123 更新时间:2023-11-29 16:13:23 24 4
gpt4 key购买 nike

我有带圆角的 ListView 。如何设置这些角的背景?我需要将它们设置为灰色,就像主背景一样,但它们是白色的。

enter image description here

我的 ListView

<ListView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/cats_list"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:cacheColorHint="#000"
android:background="@drawable/round_corners"
/>

round_corners.xml :

<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android" >
<corners android:bottomRightRadius="7dp" android:bottomLeftRadius="7dp"
android:topLeftRadius="17dp" android:topRightRadius="17dp"/>

<gradient
android:angle="180"
android:endColor="#ff0000"
android:startColor="#ff0000"
android:type="linear" />

</shape>

最佳答案

是否可以将 xml 形状的背景设置为透明?可以使用系统默认

@android:color/transparent 

关于Android:listview角落的背景,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11363564/

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