Elevation + transparent error on Android Lollipop

Using the background color for a view with some alpha (for example, # 99fe0038) and some height above API 21 shows two circles: one for the view itself and the other inside:

The height and background color are set using the code:

view.setElevation(getResources().getDimensionPixelSize(R.dimen.fab_elevation_lollipop)); view.setBackgroundColor(Color.parseColor("#99fe0038")); 

Without setting the height or using an opaque color, everything looks as expected.

Is this an Android bug or am I missing something?

+6
source share
1 answer

Removing the shadow effect worked for me.

 FAB.setShadow(false); FAB.setBackgroundColor(getResources().getColor(R.color.fab_transparent)); 
0
source

Source: https://habr.com/ru/post/978262/


All Articles