The navigation drawer is the most common feature offered by android and the navigation drawer is a UI panel that shows your app’s main navigation menu. It is also one of the important UI elements, which provides actions preferable to the users like example changing user profile, changing settings of the application, etc. The user can view the navigation drawer when the user swipes a finger from the left edge of the activity. They can also find it from the home activity by tapping the app icon in the action bar. The drawer icon is displayed on all top-level destinations that use a DrawerLayout. Have a look at the following image to get an idea about the Navigation drawer.
In this article, we will see how we change the text font of the navigation drawer’s item. Before starting we need to create a project with Side Navigation Drawer.
- Method 1: Create a new project from the file option in the left corner. Go to the File > New > New Project and Select the Navigation Drawer Activity option and enter the project name. Let the remaining things be as it is.
- Method 2: You can create a side navigation drawer manually. To do so click here Navigation Drawer in Android.
Step by Step Implementation
Step 1: Go to the app > res > values > themes > themes.xml file and write down the flowing code inside the <resources> tag.
Step 2: Open activity_main.xml file and go to NavigationView tag and set the style in itemTextAppearance attribute.
Below is the complete code for the activity_main.xml file.