【发布时间】:2019-08-17 14:09:19
【问题描述】:
就我而言,我想在中心设置工具栏标题和副标题。我已经有一种在工具栏中设置 自定义布局 的解决方案。这是在不使用自定义布局的情况下设置工具栏标题和副标题的任何其他解决方案吗?
解决方案 1:
<android.support.v7.widget.Toolbar
android:id="@+id/custom_toolbar"
android:layout_width="match_parent"
android:layout_height="?android:attr/actionBarSize"
android:background="@android:color/holo_red_dark">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="abc"
android:textColor="@android:color/white"
android:textSize="20sp"
android:layout_marginRight="?android:attr/actionBarSize"
android:gravity="center"/>
</android.support.v7.widget.Toolbar>
我不想使用自定义布局来设置工具栏标题和副标题。提前感谢您的努力。
【问题讨论】:
标签: android