我想创建一个实现MenuDrawer(使用SimonVT的android-menudrawer库)的应用程序。如何在menudrawer中设置活动元素的背景颜色
我开始使用示例左菜单作为基础。它使用箭头来指示哪个元素处于活动状态。
我的问题是,我怎样才能使活动项目显示不同颜色的背景,而不是图像。
我想创建一个实现MenuDrawer(使用SimonVT的android-menudrawer库)的应用程序。如何在menudrawer中设置活动元素的背景颜色
我开始使用示例左菜单作为基础。它使用箭头来指示哪个元素处于活动状态。
我的问题是,我怎样才能使活动项目显示不同颜色的背景,而不是图像。
在您的适配器放在一边getView()view.setSelectionHandlerColorResource(Set your color here);
类似如下:
public View getView(int position, View convertView, ViewGroup parent) {
view.setSelectionHandlerColorResource(Set your color here);
}
看到这里http://stackoverflow.com/questions/15810316/highlighting-selected-item-in -menu-drawer-sliding-menu – Hardik
对于类型View,未定义方法setSelectionHandlerColorResource(),并且问题未解决 – xAnubiSx