当前位置:编程学习 > wap >>

4.0 中的Menu怎么能同时显示图片和字符串?

<menu
    xmlns:android="http://schemas.android.com/apk/res/android">
    <item android:id="@+id/add_birthday_reminder"
        android:alphabeticShortcut="r"
        android:title="@string/birthday_add"
        android:icon="@*android:drawable/ic_suggestions_add"
        android:showAsAction="withText|always" />
</menu>
如下图右上角的加号。
若没有icon就能显示title指定的字符串,若有icon,横屏能全部显示,但竖屏只能显示icon不显示文字,能不能
竖屏时同时显示?
--------------------编程问答-------------------- --------------------编程问答-------------------- frameworks\base\core\res\res\values\Config.xml

<!-- Whether action menu items should be displayed in ALLCAPS or not.
         Defaults to true. If this is not appropriate for specific locales
         it should be disabled in that locale's resources. -->
<bool name="config_actionMenuItemAllCaps">true</bool>
--------------------编程问答-------------------- 错了,是这个
<!-- Whether action menu items should obey the "withText" showAsAction
         flag. This may be set to false for situations where space is
         extremely limited. -->
<bool name="config_allowActionMenuItemTextWithIcon">true</bool>

引用 2 楼  的回复:
frameworks\base\core\res\res\values\Config.xml

XML code
<!-- Whether action menu items should be displayed in ALLCAPS or not.
         Defaults to true. If this is not appropriate for specific lo……
补充:移动开发 ,  Android
CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,