Tôi muốn có thanh công cụ appcompat v21 trong hoạt động của mình. Nhưng thanh công cụ tôi đang thực hiện đang chồng chéo bên dưới thanh trạng thái. Làm thế nào tôi có thể sửa chữa nó?
Đây là cách bố trí hoạt động xml:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<include
android:id="@+id/toolbar"
layout="@layout/toolbar" />
<FrameLayout
android:id="@+id/container"
android:layout_width="fill_parent"
android:layout_height="0dp"
android:layout_weight="1" />
</LinearLayout>
Giao diện thanh công cụ:
<?xml version="1.0" encoding="utf-8"?>
<android.support.v7.widget.Toolbar xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:minHeight="?attr/actionBarSize"
android:background="?attr/colorPrimary" />
Phong cách chủ đề:
<style name="AppTheme" parent="MaterialNavigationDrawerTheme.Light.DarkActionBar">
<item name="colorPrimary">@color/primary</item>
<item name="colorPrimaryDark">@color/primary_dark</item>
<item name="colorAccent">@color/accent</item>
</style>
CoordinatorLayout
bạn có thể thử điều này: stackoverflow.com/a/47906087/2201814
Theme
applicaiton của bạn? Đăng chúng lên.