【发布时间】:2017-07-17 07:49:39
【问题描述】:
我在 AppCompatActivity 中使用自定义操作栏。我在下面给出我的代码以及投手。我尝试了堆栈溢出中可用的所有解决方案。但是直到我无法解决这个问题。请帮助我。
action_toolbar.xml
<android.support.v7.widget.Toolbar xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/toolbar"
style="@style/toolBarTheme"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:minHeight="?attr/actionBarSize"
app:contentInsetStart="0dp"
app:theme="@style/AppTheme.AppBarOverlay">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<ImageView
android:id="@+id/appLogo"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:contentDescription="@string/app_name"
android:src="@mipmap/ic_launcher" />
<TextView
android:id="@+id/tvToolbarTitle"
style="@style/textViewTheme"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_toRightOf="@+id/appLogo"
android:layout_toEndOf="@+id/appLogo"
android:layout_marginLeft="14dp"
android:layout_marginStart="14dp" />
</RelativeLayout>
【问题讨论】:
标签: android android-layout android-actionbar