About the usage skills of Navigation Drawer Activity in Android studio

1. First find the item in the activity_main2_drawer layout folder, where you can realize the button display interface of the function you want

2. If the icon of the item interface cannot be displayed, open your main class (I am Main2Activity here), and find the statement after the onclick function:

NavigationView navigationView = binding.navView;

Add an initialization statement below this statement and set it to a null value:

navigationView.setItemIconTintList(null);

 

as shown in the picture

3. The following code is the mailbox icon on the main interface, which can be deleted

 4. The functions to realize fragment jump are all found in the main class

Guess you like

Origin blog.csdn.net/qq_74629570/article/details/130021269