Missing Toolbar Shadow? Here’s A Proper Way To Set Toolbar Shadow With AppComapt

As Google has introduced new #AppComapt library since the arrival of Lollipop, new Toolbar widget is a standard replacement for legacy action bar.

However, the toolbar of #AppCompat not showing shadow which breaks the whole UI. Following screen shot shows the toolbar which doesn’t show the shadow:

toobar_without_shadow.jpg

So here is a standard solution to see the proper shadow below the #Toolbar, see the below snippet:

toobar_with_shadow_color.jpgHere, as seen in the above screen shot, the solution is to wrap your #Toolbar with the new #AppBarLayout view which will give you the exact shadow which you are looking for.

See the below screen shot which shows proper shadow right below the toolbar, thanks to the new AppBarLayout.

toolbar_with_shadow.jpg

For more tips on styling in Android, stay tuned…!!!