我想創建一個實現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