设置菜单项的标题出现在Android上的所有帽 [英] setting menu item's title appears as all cap on android

查看:152
本文介绍了设置菜单项的标题出现在Android上的所有帽的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个菜单项,在<一个解释href="http://stackoverflow.com/questions/17537345/how-do-i-add-a-button-as-a-menu-item/17537467?noredirect=1#comment25506177_17537467">How我添加一个按钮,菜单项?。当我使用的图标,我可以点击图标罚款。但是,当我使用 actionLayout ,我收到的点击没有反应。这里是按钮 actionLayout 点:

I have a menu item as explained in How do I add a button as a menu item?. When I use an icon, I can click on the icon fine. But when I use an actionLayout, I am getting no response on click. Here is the button the actionLayout points to:

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content" >

    <Button
        android:id="@+id/my_btn"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_margin="5dp"
        android:layout_marginRight="15dp"
        android:background="#999999"
        android:text="Apple" />

</RelativeLayout>

任何想法如何解决这个问题?我们的想法是使用一个可绘制的我自己的看法吧。

Any ideas how to fix this problem? The idea is to use my own view instead of a drawable.

推荐答案

其实我看着办吧。我用

<Button  xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/my_btn"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_margin="5dp"
    android:layout_marginRight="15dp"
    android:background="#999999"
    android:text="Apple" />

与getActionView

with getActionView

这篇关于设置菜单项的标题出现在Android上的所有帽的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆