Java Android ActionBar-尽管API级别为14,但属性showAsAction没有资源
我一直在努力将Actionbar集成到我的项目中,但找不到解决问题的方法:我正在使用API版本14(在Android Build Target&Manifest文件中设置,之后也进行了清理),但我的菜单xml文件显示以下错误: 错误:在包“com.freelaxing.yamas”中找不到属性“showAsAction”的资源标识符 有人知道这里发生了什么吗Java Android ActionBar-尽管API级别为14,但属性showAsAction没有资源,java,android,android-actionbar,android-xml,Java,Android,Android Actionbar,Android Xml,我一直在努力将Actionbar集成到我的项目中,但找不到解决问题的方法:我正在使用API版本14(在Android Build Target&Manifest文件中设置,之后也进行了清理),但我的菜单xml文件显示以下错误: 错误:在包“com.freelaxing.yamas”中找不到属性“showAsAction”的资源标识符 有人知道这里发生了什么吗 <menu xmlns:android="http://schemas.android.com/apk/res/android"
<menu xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:yourapp="http://schemas.android.com/apk/res-auto">
<item
android:id="@+id/action_change_account"
android:orderInCategory="100"
android:showAsAction="never"
android:title="@string/action_change_account"
yourapp:showAsAction="ifRoom" />
<item
android:id="@+id/action_change_yamas_account"
android:orderInCategory="100"
android:showAsAction="never"
android:title="@string/action_selectyamaschannel"
yourapp:showAsAction="ifRoom" />
</menu>
您可能正在检查项目属性文件。(target=android-14)您可能正在检查项目属性文件。(target=android-14)为什么你甚至需要你的应用程序:showAsAction=“ifRoom”
?如果我没记错的话,这应该只用于appcompat-v7 lib中的ActionBarCompat
。你不需要一个,因为目标是API 14
因此,只要试着用
yourapp:showAsAction=“ifRoom”
和XMLNS-definitionXMLNS:yourapp=”删除两行即可http://schemas.android.com/apk/res-auto“
来自根标签。为什么你甚至需要你的应用程序:showAsAction=“ifRoom”
?如果我没记错的话,这应该只用于appcompat-v7 lib中的ActionBarCompat
。你不需要一个,因为目标是API 14
因此,只要试着用
yourapp:showAsAction=“ifRoom”
和XMLNS-definitionXMLNS:yourapp=”删除两行即可http://schemas.android.com/apk/res-auto“
来自根标记。它说:target=android-15在您的xml中第二个xmlns attr是什么?它说:target=android-15在您的xml中第二个xmlns attr是什么?