gpt4 book ai didi

java - 如何将较暗的透明度添加到我的相对布局中,如图所示?

转载 作者:行者123 更新时间:2023-12-02 09:28:09 26 4
gpt4 key购买 nike

我尝试做很多事情:设置 alpha 值,设置背景:透明度,设置背景不同的颜色,如“#90000000”,我什至在我的 recilerView 上方创建了另一个具有透明度的 View 。但我总是有一个结果:

(不要看白图,我稍后会设置)

我需要这样的透明度:

enter image description here

如您所见,图像和线条不处于透明状态。您有任何解决办法吗?

最佳答案

我认为你在root前面声明了RecyclerView,如果您在 xml 布局中使用像主视图这样的relativelayout,则必须确保您的透明 View 位于 RecyclerView 下方,这是一个示例:

<小时/>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent" android:layout_height="match_parent">
<RecyclerView
android:layout_width="match_parent"
android:layout_height="match_parent">
</RecyclerView>
<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#9A000000">
</FrameLayout>

关于java - 如何将较暗的透明度添加到我的相对布局中,如图所示?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58187305/

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