Change NavigationDrawer Icon In Android Studio
In this tutorial we are going to learn to change icon on navigation drawer. In previous android studio we have to create navigation drawer manually but now in latest android studio , we have provided Navigation drawer.
When we create NavigationDrawer activity following xml file were formed which are :-
- NavigationBar Drawer
Now we are going to change icon of navigation drawer to do so follow just simple steps .
we can also change the launcher icon of our application with just some simple steps , we have discuss it in other artical you can take that as reference to change launcher logo of application .
- Click on Resource Folder
- Now click on Menu
- Find the Activity_your_activity_name_Drawer file
Here we can see all the icon which are added by default in navigation drawer now to change this .
Creating New Material Icon In Android studio
To change icon we have to create a material icon in @drawable folder which is done with ..
Step 1: – Right click on Drawable in the resource folder.
Step 2:- Click on vector asset .
Step 3:- Chose the icon you want .
Step 4:- Selecting the icon that you want to set .
To change the icon just replace the name of the icon which you have created with the previous one , as shown in the code below .
<item android:id="@+id/nav_camera" android:icon="@drawable/ic_menu_camera" //change the icon name here android:title="Camera" />
<item android:id="@+id/nav_camera" android:icon="@drawable/profile_image" android:title="Profile" />
Now icon of Navigation Drawer is changed .
if you will get any kind of difficulty you can share with us . share your views and stay connected with softwoodcoder.