Beena
Beena

Reputation: 2354

view SetAlpha not working in android version 5 - lollipop

I have set alpha to my relative layout in following way,

holder.layoutMenuItem.getBackground().setAlpha(alpha*255/100);  

It is working perfect in all versions except verion 5 - lollipop. Any one is having solution to this issue?

Upvotes: 2

Views: 2120

Answers (1)

QArea
QArea

Reputation: 4981

You can try this:

view.setBackgroundColor(Color.parseColor("#**238974")); 

Where * is your Alpha level.

In my case view.setAlpha((float)0.3); worked perfectly too.

Upvotes: 1

Related Questions