使用ActionBar for android我想在它的左边添加一个菜单按钮

时间:2015-06-25 02:41:08

标签: android xml android-actionbar

我基本上想在操作栏的最左边添加一个菜单按钮;就像它在导航抽屉布局中一样:

Image of where exactly I want to add the menu icon

必须有一种简单的方法可以做到这一点,我正在阅读的所有教程对于已经可用于应用程序模板的内容来说似乎很复杂。

1 个答案:

答案 0 :(得分:0)

最简单的解决方案:创建自定义toolbar 添加imageviewtextview

 <toolbar ...>
    <imageview... /><--your image-->

 </toolbar>

或者您可以更改活动图标。

getActionBar().setIcon(R.drawable.my_icon);