Menu items should specify a title(解决方法)
来源:互联网 发布:淘宝手机端图片模糊 编辑:程序博客网 时间:2024/06/16 11:54
Just a wrong XML namespace! Try with:
<menu xmlns:android="http://schemas.android.com/apk/res/android"></menu>
And as G.T. suggested you should consider using appcompat on the showAsAction
property (only needed if you want to support API < 11):
<menu xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto"> <item android:id="@+id/item1" android:icon="@drawable/ic_launcher" app:showAsAction="ifRoom|withText" android:title="@string/Add_New" /></menu>
Note:
The appcompat library is compatible with some old Android versions (API 7+) that can't handle the showAsAction
property because they don't have the ActionBar
(API < 11).
Thanks a million, worked like a charm! – user3375184 Jan 28 '15 at 14:59
add a comment
up vote0down vote
Try this:
<menu xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto"><item android:id="@+id/item1" android:icon="@drawable/ic_launcher" android:title="@string/Add_New" app:showAsAction="ifRoom|withText"></item></menu>
It works for me perfectly.
I can't see what you added to my answer. – Gorcyn Jan 27 '15 at 15:19
http://stackoverflow.com/questions/28157511/android-studio-menu-item
0 0
- Menu items should specify a title(解决方法)
- 报错:menu中的item,提示:Menu items should specify a title less... (Ctrl+F1)
- IDBUX: Radio Menu Items
- No refs in common and none specified; doing nothing. Perhaps you should specify a branch such as 'ma
- Adding Menu Items Based on an Intent
- UNITY EDITOR EXTENSIONS – MENU ITEMS[详]
- BHO开发浏览器插件-Adding Menu Items
- Android menu菜单items间隔设置
- Popup menu with nice title
- Error:NB:JAVA_HOME should point to a JDK not a JRE解决方法
- TOMCAT启动提示NB: JAVA_HOME should point to a JDK not a JRE解决方法
- A. Valera and Antique Items
- Template within template: why “`>>' should be `> >' within a nested template argument list” 解决方法
- 谷歌眼镜Mirror API之Menu Items
- Menu Items are not showing on Action Bar
- Unity Editor Extensions – Menu Items私人定制
- Unity Editor Extensions – Menu Items私人定制
- ;TITLE Reversing a String
- leetcode 104. Maximum Depth of Binary Tree
- 《TCP/IP详解卷一:协议》学习笔记四
- (未完待续.....)第六届蓝桥杯省赛B组--垒骰子
- GUI界面,Swing、JTextPane面板、事件驱动模型(监听器)
- 煤球数目
- Menu items should specify a title(解决方法)
- 在CentOS 7下安装Redis
- Unity之Tango开发入门
- Hbase恢复误删数据
- Java 多态
- 移植QT5.6到嵌入式开发板(史上最详细的QT移植教程)
- Java SE 中swing的简单实例 ( swing实现简单学生管理系统的登录界面)
- 科研总结
- C++11:变长模板的迭代与递归扩展