简体   繁体   English

我怎样才能让我的recyclerview半透明

[英]How can i make my recyclerview translucent

I am trying to make a fragment for search view, where i want my recycler view to be translucent ( the whole view ).我正在尝试为搜索视图制作一个片段,我希望我的回收站视图是半透明的(整个视图)。

Something like this:像这样: 在此处输入图像描述

i tried changing the alpha, but it did not help much?我尝试更改 alpha,但没有多大帮助? suggestions on what can be done ?关于可以做什么的建议?

Just set the background colour of your recycler view to transparent colour value.只需将回收站视图的背景色设置为透明色值即可。 Transparent hex code: #00000000透明十六进制代码:#00000000

And if you want it to be translucent then, try using the colour picker of android studio and change the opacity accordingly to get your desired transparency.如果您希望它是半透明的,请尝试使用 android 工作室的颜色选择器并相应地更改不透明度以获得您想要的透明度。

I figured it out !!我想到了 !!

I added a empty view on top of the reyclerview, with a background colour & alpha of 0.1我在 reyclerview 顶部添加了一个空视图,背景颜色和 alpha 为 0.1

also changed the alpha of the recycler view to 0.5还将回收站视图的 alpha 更改为 0.5

Adding the extra empty view was the key that i was missing添加额外的空视图是我缺少的关键

Adding the extra empty view was the key that i was missing添加额外的空视图是我缺少的关键

I think so too.我也这么认为。 It is a good and simple way.这是一个很好的简单方法。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM