[英]Android - custom tab bar icon on ActionBarSherlock produces error
我在此項目中使用ActionBarSherlock和HoloEverywhere。 Main.xml非常簡單,看起來像這樣:
<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>
我在drawable-mdpi,drawable-hdpi和drawable-xhdpi中有ic_menu_customsettings.png。 我收到以下錯誤:
Error: No resource found that matches the given name (at 'icon' with value '@android:drawable/ic_menu_customsettings').
除了將png文件放在這些文件夾中以使ActionBar可以訪問它們之外,我是否還需要做其他事情?
正確的行是:
android:icon="@drawable/ic_menu_customsettings"/>
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.