Failed to find style 'listMenuViewStyle' in Android Studio

旧城冷巷雨未停 提交于 2019-12-23 19:17:39

问题


I'm trying to add icons to my menu items in my android application. However the layout preview window in Android studio is displaying the error:

Failed to find style 'listMenuViewStyle' in current theme

I'm using the Holo.Light theme, and have tried a number of other themes with no luck. My layout xml is as follows:

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

    xmlns:tools="http://schemas.android.com/tools"
    tools:context="com.me.myApp.activities.StartActivity" >

    <item android:id="@+id/action_settings"
        android:title="@string/menu_section_settings"
        android:icon="@drawable/ic_settings"
        android:showAsAction="never" />

    <item android:id="@+id/action_about"
        android:title="@string/menu_section_about"
        android:icon="@drawable/ic_help"
        android:showAsAction="never" />

</menu>

What am I missing here? Thanks!


回答1:


The attribute listMenuViewStyle was introduced with api level 24. Make sure you use compileSdkVersion 24 or above.



来源:https://stackoverflow.com/questions/39590620/failed-to-find-style-listmenuviewstyle-in-android-studio

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!