简体   繁体   English

Eclipse / Android错误:不允许使用字符串类型

[英]Eclipse/Android error: String types not allowed

I have an options_menu.xml file like this: 我有一个options_menu.xml文件,如下所示:

<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android">
<item android:id="@+id/search"
      android:title="@string/search_title"
      android:icon="@drawable/ic_search"
      android:showAsAction="collapseActionView|ifRoom"
      android:actionViewClass="android.widget.SearchView" />
</menu>

When I do a project -> clean or a build, I get an error: 当我执行一个项目-> clean或build时,出现错误:

String types not allowed (at 'showAsAction' with value 'collapseActionView|ifRoom') 不允许的字符串类型(在'showAsAction'处,值为'collapseActionView | ifRoom')

I cannot figure out what is wrong. 我不知道怎么了。 My target SDK version is 11. Does anybody know what is causing this? 我的目标SDK版本是11。有人知道是什么原因吗?

Thanks, Igor 谢谢,伊戈尔

Remove collapseActionView It is introduced from Api Level 14 and your level is 11.Remove it try.hope it will work. 删除collapseActionView它是由API级别14引入和你的水平是11.Remove它try.hope它会工作。

Here you can check it. 在这里您可以检查它。

I solved my own issue. 我解决了自己的问题。 According to the docs, collapseActionView was introduced in API level 14. So I just had to change my target SDK version. 根据该文档,collapseActionView API等级14所以我不得不改变我的目标SDK版本中引入的。 More here: Menu Resource 更多内容: 菜单资源

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Android-错误:不允许使用字符串类型(在“ imageViewScramble”中值为“”) - Android - Error:String types not allowed (at 'imageViewScramble' with value '') 错误:不允许使用字符串类型 - Error:String types not allowed Android动画-不允许使用字符串类型 - Android Animation - String types not allowed Android + Admob:错误:不允许的字符串类型(在&#39;configChanges&#39;与值(等)) - Android+Admob: Error: String types not allowed (at 'configChanges' with value(etc…) 错误:Android Studio中不允许使用字符串类型(在“主题”中值为“”) - Error : String types not allowed (at 'theme' with value ") in android studio 清单文件中的android:configChanges不允许使用错误字符串类型 - Error string types not allowed at android:configChanges in manifest file android admob集成问题 - 不允许使用字符串类型 - android admob integration issue - string types not allowed 不允许的字符串类型-axml Xamarin android - string types not allowed - axml Xamarin android 不允许的字符串类型(在&#39;android:importantForAccessibility&#39;处,值为&#39;noHideDescendants&#39;) - String types not allowed (at 'android:importantForAccessibility' with value 'noHideDescendants') 错误:不允许使用字符串类型(在'screenOrientation'中,值为'sensorPortait') - Error: String types not allowed (at 'screenOrientation' with value 'sensorPortait')
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM