1

I have a navigation icon (white color) with dynamic background images , sometimes when I get white bg image , navigation icon is not visible. Suggested solution is to add shadows, but how do I add shadow to icon ?

AndroidDev
  • 1,485
  • 2
  • 18
  • 33

2 Answers2

0

If you have your own toolbar, try this solution (add your own icon file).

yourtoolbar.post(new Runnable() {
        @Override
        public void run() {
            Drawable drawable = ResourcesCompat.getDrawable(getResources(), R.drawable.your_icon_with_shadow, null);
            yourtoolbar.setNavigationIcon(drawable);
        }
});
  • R.mipmap.ic_launcher refers to navigation icon ?, But where is shadow effect getting added. – AndroidDev May 30 '17 at 08:31
  • yes this reffers to your application icon (as example), if you want to replace default icon with custom icon that has shadow, insert that file in drawable folder and call it there (R.drawable.yournewicon) – Miroslav Ranisavljevic May 30 '17 at 08:35
0

Change the white navigation image and Make same image with Shadow in .png format

Sumit Pathak
  • 529
  • 2
  • 7
  • 24