2011-10-07 139 views

回答

0

我发现这个在ActionBar GitHub的页面 https://github.com/johannilsson/android-actionbar/issues/31

我建议你尝试新的版本是在分支模仿本地的API上。然后,您可以简单地在动作上使用setIcon。

所以克隆此分支,应该有一个的setIcon方法,我会尝试自己一点以后。

0

有不同的图像取决于如果你按下一个按钮或没有,做这样一个XML文件中可绘制文件夹:

<selector xmlns:android="http://schemas.android.com/apk/res/android"> 
<item android:state_focused="true" 
     android:state_pressed="true" 
     android:drawable="@drawable/menu_tools_green"/> 
<item android:state_focused="false" 
     android:state_pressed="true" 
     android:drawable="@drawable/menu_tools_green"/> 
<item android:state_focused="true" 
     android:drawable="@drawable/menu_tools_green"/> 
<item android:state_focused="false" 
     android:state_pressed="false" 
     android:drawable="@drawable/menu_tools_orange"/> 

正如你可以看到有每个状态的照片。

Regards