android开发分享如何使透明渐变?

我有以下渐变:

<?xml version="1.0" encoding="utf-8"?> <shape xmlns:android="https://schemas.android.com/apk/res/android"> <gradient android:startColor="#ECECEC" android:centerColor="#F6F6F4" android:endColor="#F8F8F6" android:angle="90" android:dither="true" /> </shape> 

我想这是透明的,因为在我的ListView中,我将其设置为我的ListSelector:

 <ListView android:layout_width="fill_parent" android:layout_height="fill_parent" xmlns:android="https://schemas.android.com/apk/res/android" android:id="@+id/ARListView" android:background="@drawable/transparent_background" android:cacheColorHint="#00000000" android:drawSelectorOnTop="true" android:listSelector="@drawable/stocks_selected_gradient"> </ListView> 

    只需使用一个8位数的颜色值,例如#FFF8F8F6,其中前两个字符是alpha值。 FF是完全不透明的,00是完全透明的。

    android:background =“#00000000”android:cacheColorHint =“#00000000”

    这将使透明,但这是为了使其透明度…

      以上就是android开发分享如何使透明渐变?相关内容,想了解更多android开发(异常处理)及android游戏开发关注计算机技术网(www.ctvol.com)!)。

      本文来自网络收集,不代表计算机技术网立场,如涉及侵权请联系管理员删除。

      ctvol管理联系方式QQ:251552304

      本文章地址:https://www.ctvol.com/addevelopment/515119.html

      (0)
      上一篇 2020年11月30日
      下一篇 2020年11月30日

      精彩推荐