2
是否可以调整中心的工具栏的菜单图标?我用另一种方式显示here,但那里是我的工具栏布局中的图像。现在我想尝试一下菜单图标:)。调整中心的工具栏的菜单项
这里是我的代码。
bottm工具栏
<?xml version="1.0" encoding="utf-8"?>
<android.support.v7.widget.Toolbar
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
xmlns:appo="http://schemas.android.com/apk/res-auto"
android:minHeight="50dp"
android:background="@color/colorPrimary"
appo:theme="@style/ToolbarTheme"
appo:popupTheme="@style/Theme.AppCompat.Light">
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/news"
app:showAsAction="always"
android:orderInCategory="100"
android:icon="@drawable/new_icon"
android:title="News">
</item>
<item
app:showAsAction="always"
android:id="@+id/camera"
android:icon="@drawable/camera_icon"
android:orderInCategory="100"
android:title="Camera"
></item>
<item
app:showAsAction="always"
android:id="@+id/facebook"
android:icon="@drawable/facebooc_image"
android:orderInCategory="100"
android:title="Camera"
>
</item>
有没有这样的方式来居中optionsMenu,你必须把它放在'工具栏' –