【发布时间】:2020-05-01 08:11:12
【问题描述】:
我编写了这段代码来在导航抽屉中的菜单项右侧添加箭头。我为每个索引分别重复了相同的代码。
navigationView.getMenu().getItem(0).setActionView(R.layout.arrow_image);
navigationView.getMenu().getItem(1).setActionView(R.layout.arrow_image);
navigationView.getMenu().getItem(2).setActionView(R.layout.arrow_image);
有什么方法可以指定所有的索引号(这里是 0,1 和 2),其中箭头应该只出现在一行中?
【问题讨论】: