简体   繁体   中英

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? suggestions on what can be done ?

Just set the background colour of your recycler view to transparent colour value. Transparent hex code: #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.

I figured it out !!

I added a empty view on top of the reyclerview, with a background colour & alpha of 0.1

also changed the alpha of the recycler view to 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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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