我想更改每个添加的菜单的每个布局。这是代码:
private void addPlacesToMenu() {
int index = 0;
NavigationView navigationView = (NavigationView) findViewById(R.id.nav_view);
NavigationMenu menu = (NavigationMenu)navigationView.getMenu();
navigationView.setNavigationItemSelectedListener(this);
final ArrayList<String> allPlaces = placesDAO.allPlacesByName();
for (String p : allPlaces) {
menu.add(allPlaces.get(index));
index++;
}
}