2014-05-12 71 views
0

我在這個項目中使用ActionBarSherlock和HoloEverywhere。 main.xml中是相當簡單的,看起來像這樣:Android - 自定義標籤欄上ActionBarSherlock圖標產生錯誤

<menu xmlns:android="http://schemas.android.com/apk/res/android" > 

<item 
    android:id="@+id/action_settings" 
    android:orderInCategory="100" 
    android:showAsAction="ifRoom|withText" 
    android:title="@string/action_info_settings" 
    android:icon="@android:drawable/ic_menu_customsettings"/> 

</menu> 

我在繪製-MDPI,繪製,華電國際,並繪製-xhdpi ic_menu_customsettings.png。我收到以下錯誤:

Error: No resource found that matches the given name (at 'icon' with value '@android:drawable/ic_menu_customsettings'). 

我應該做的事情比把PNG文件在這些文件夾,使他們通過動作條訪問嗎?

+0

你走你不需要做任何事情,更正確的步驟,你嘗試過清理項目或重新啓動Eclipse的? –

+0

是的。在清理完項目後,我得到了那個錯誤和9個更多的錯誤,都說「R不能解析爲變量」。 – Anonymous1

+0

確保您的導入中沒有R文件 –

回答

0

正確的路線是:

android:icon="@drawable/ic_menu_customsettings"/>