什么是orderInCategory动作条中的菜单项和放大器;为什么它是用于..? [英] What is orderInCategory in ActionBar menu item & why it is use for..?

查看:230
本文介绍了什么是orderInCategory动作条中的菜单项和放大器;为什么它是用于..?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

进出口工作的操作菜单项,其对流量项目,这是我的 main_menu.xml

Im working on action menu item and its over flow item this is my main_menu.xml

<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">

<item
    android:id="@+id/menu_search"
    android:icon="@drawable/search"
    android:title="@string/start_new_project"
    app:showAsAction="always" />
<item
    android:id="@+id/menu_dts_overflow"
    android:icon="@drawable/ic_action_overflow_round"
    android:orderInCategory="11111" 
    android:title="Service"
    app:showAsAction="always">
    <menu>
        <item
            android:id="@+id/menu_newProject"
            android:icon="@drawable/newproject"
            android:title="@string/start_new_project"
            app:showAsAction="never" />


        <item
            android:id="@+id/menu_help"
            android:icon="@drawable/help"
            android:title="Service Tasks"
            app:showAsAction="never" />


        <item
            android:id="@+id/menu_signOut"
            android:icon="@drawable/signout"
            android:title="@string/menusignout"
            app:showAsAction="never" />

    </menu>
</item>

我试图构建一个搜索项和溢出项,你可以在上面code见。我是新来操作栏菜单项,所以我想谷歌它,并能使其工作,因为我需要。

I tried to construct a search item and a overflow item which you can see in the above code. I'm new to Action bar menu items so i tried to Google it and was able to make it work as I need.

在此我必须知道一件事。

In this I have to know one more thing.

1 什么是 orderInCategory 有一些数字,什么它是用来..?

1. What is orderInCategory with some numbers and what for it is used..?

推荐答案

安卓orderInCategory 属性决定了顺序的菜单项将出现在菜单中时,被显示。菜单项被安排由左到右的 orderInCategory 整数值按升序排列。(即1,2,3 ... - >左到右)

The android:orderInCategory attribute dictates the order in which the menu items will appear within the menu when it is displayed. The menu items are arranged from left to right in ascending order of integer value of orderInCategory (i.e. 1,2,3... -> left to right).

这篇关于什么是orderInCategory动作条中的菜单项和放大器;为什么它是用于..?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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