gpt4 book ai didi

android - 我想在 android 中的背景图像中添加透明叠加层

转载 作者:行者123 更新时间:2023-12-02 23:53:08 25 4
gpt4 key购买 nike

我想在 Android 中为我的背景图像添加透明叠加层,如下所示

enter image description here

我的代码

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="com.bykar.bykar_provider.WaitingForActivationActivity">

<ImageView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:contentDescription=""
android:scaleType="centerCrop"
android:src="@drawable/map_bg"
tools:ignore="ContentDescription" />

<View
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/black"
/>
</RelativeLayout>

最佳答案

添加背景以查看为 20% 不透明

<View
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#26000000"/>

如果您需要,这里是不透明度值:

100% — FF
95% — F2
90% — E6
85% — D9
80% — CC
75% — BF
70% — B3
65% — A6
60% — 99
55% — 8C
50% — 80
45% — 73
40% — 66
35% — 59
30% — 4D
25% — 40
20% — 33
15% — 26
10% — 1A
5% — 0D
0% — 00

关于android - 我想在 android 中的背景图像中添加透明叠加层,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46113955/

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