android中的自定义操作栏

android中的自定义操作栏,android,android-actionbar,navigation-drawer,Android,Android Actionbar,Navigation Drawer,我需要自定义动作栏,使其看起来像这张照片 当点击右边的图片时,它会从屏幕右边打开幻灯片菜单,效果很好 我已经试过了 getActionBar().setBackgroundDrawable(getResources().getDrawable(R.drawable.action_bar)); getActionBar().setDisplayHomeAsUpEnabled(true); getActionBar().setHomeButtonEnabled(true); ac

我需要自定义动作栏,使其看起来像这张照片

当点击右边的图片时,它会从屏幕右边打开幻灯片菜单,效果很好 我已经试过了

getActionBar().setBackgroundDrawable(getResources().getDrawable(R.drawable.action_bar));
    getActionBar().setDisplayHomeAsUpEnabled(true);
    getActionBar().setHomeButtonEnabled(true);
action_bar.xml

<?xml version="1.0" encoding="UTF-8"?>


对于搜索和设置图标,我在main.xml中使用了这个


这是我到目前为止所拥有的


有什么需要帮助的吗首先请确定。。使用删除你的标题

getActionBar().setDisplayShowTitleEnabled(false);

然后,您应该在xml文件中使用orderInCategory,它将从较小的数字到较大的数字排序(从操作栏的左侧)

如果您使用的是Android的本机Actionbar,则只有在Android 4.2之后才支持正确的RtL:


如果您想支持较旧的Android版本,您可能必须自定义一个开源actionbar库,并使用它从右滑动操作。

但是打开滑动窗口的徽标图标不在menu.xml文件中。如何将其从左向右移动?您是否尝试将其声明为“Android:showAsAction=”always“?操作栏左侧仍然相同
<item
    android:id="@+id/action_settings"
    android:orderInCategory="100"
    android:showAsAction="never"

    android:title="@string/action_settings"/>

 <item
    android:id="@+id/action_help"
    android:icon="@drawable/assetting"
    android:showAsAction="always"/>

<item
    android:id="@+id/action_search"
    android:icon="@drawable/assearch"
    android:showAsAction="always"/>
getActionBar().setDisplayShowTitleEnabled(false);