使用最后一个android.support.v7.widget.Toolbar
我想在工具栏中居中一个图像,但它一直停留在左边.
对我来说最好的方法是使用toolbar.setLogo()
方法并使徽标居中,但我看不到任何方法.
我使用的布局Toolbar
:
<android.support.v7.widget.Toolbar style="@style/ToolBarStyle"
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?attr/colorPrimary"
android:minHeight="@dimen/abc_action_bar_default_height_material">
</android.support.v7.widget.Toolbar>
Run Code Online (Sandbox Code Playgroud)
是否有可能在工具栏中添加图像(徽标)并使其居中?以编程方式或在布局中?