码迷,mamicode.com
首页 > 其他好文 > 详细

actionBar

时间:2015-05-28 15:46:08      阅读:133      评论:0      收藏:0      [点我收藏+]

标签:

 

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        MenuInflater inflater = getMenuInflater();
        inflater.inflate(R.menu.menu, menu);
        return true;
    }

 

<?xml version="1.0" encoding="utf-8"?>
<menu
    xmlns:android="http://schemas.android.com/apk/res/android">
    <item
        android:id="@+id/menu_favorites"
        android:icon="@drawable/menu_favorites_selector"
        android:title="@string/fmradio_strings_menu_favorites_txt"
        android:orderInCategory="0"
        android:showAsAction="ifRoom" />
    <item
        android:id="@+id/menu_trackid"
        android:icon="@drawable/trackid_button_selector"
        android:title="@string/fmradio_strings_menu_track_id_txt"
        android:orderInCategory="1"
        android:visible="false"
        android:showAsAction="ifRoom" />
    <item
        android:id="@+id/menu_facebook_like"
        android:icon="@drawable/facebook_like_button_selector"
        android:title="@string/description_facebook_like"
        android:orderInCategory="2"
        android:visible="false"
        android:showAsAction="ifRoom" />
    <item
        android:id="@+id/menu_toggle_power"
        android:icon="@drawable/icn_action_power"
        android:title="@string/description_power"
        android:orderInCategory="3"
        android:showAsAction="always" />
    <item
        android:id="@+id/menu_rescan"
        android:title="@string/fmradio_strings_menu_rescan_radio_stations_ics_txt"
        android:orderInCategory="3"
        android:showAsAction="never" />
    <item
        android:id="@+id/menu_play_in_speaker"
        android:title="@string/fmradio_strings_menu_play_in_speaker_ics_txt"
        android:orderInCategory="4"
        android:showAsAction="never" />
    <item
        android:id="@+id/menu_play_in_headphones"
        android:title="@string/fmradio_strings_menu_play_in_headphones_ics_txt"
        android:orderInCategory="4"
        android:showAsAction="never" />
    <item
        android:id="@+id/menu_play_in_mono"
        android:title="@string/fmradio_strings_menu_play_in_mono_ics_txt"
        android:orderInCategory="5"
        android:showAsAction="never" />
    <item
        android:id="@+id/menu_play_in_stereo"
        android:title="@string/fmradio_strings_menu_play_in_stereo_ics_txt"
        android:orderInCategory="5"
        android:showAsAction="never" />
    <item
        android:id="@+id/menu_select_region"
        android:title="@string/fmradio_strings_menu_set_radio_region_txt"
        android:orderInCategory="6"
        android:showAsAction="never" />
    <item
        android:id="@+id/menu_visualizer"
        android:title="@string/fmradio_strings_menu_visualizer_txt"
        android:orderInCategory="7"
        android:showAsAction="never" />

    <!-- Debug menu items below -->
    <item
        android:id="@+id/menu_debug_toggle_frequency_precision"
        android:title="Change nbr decimals"
        android:orderInCategory="8"
        android:showAsAction="never"
        android:visible="false" />

    <item
        android:id="@+id/menu_send_feedback"
        android:title="@string/fmradio_strings_menu_send_feedback_txt"
        android:orderInCategory="9"
        android:showAsAction="never"
        android:visible="false" />
</menu>

 

actionBar

标签:

原文地址:http://www.cnblogs.com/muhe221/p/4535921.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!