Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to make android layout background transparent?

Make android layout background transparent

How to make RecyclerView item background transparent I need to show background image?

I tried 3 solutions given in Stack Overflow and not worked for me

1 : android:background="?android:attr/selectableItemBackground"<br>
2 : android:background="@android:color/transparent"<br>
3 : alpfha 0.4

udated i also tried
4: android:background="@null" (Answer from this post) and not working

full xml code

like image 269
Midhilaj Avatar asked Jun 19 '26 15:06

Midhilaj


2 Answers

Try to give this on your item CardView

 app:cardBackgroundColor="@android:color/transparent"
like image 136
Drashti Joshi Avatar answered Jun 22 '26 05:06

Drashti Joshi


So for the layout you are inflating for the item you can use android:background="@null"

You can also use developer options on your device to see layout bounds or check the view hierarchy to see which item is giving you problems

like image 24
Zachary Sweigart Avatar answered Jun 22 '26 05:06

Zachary Sweigart



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!