Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/string/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android 导航栏覆盖工具栏中的“我的图标”_Android_Toolbar_Navigationbar - Fatal编程技术网

Android 导航栏覆盖工具栏中的“我的图标”

Android 导航栏覆盖工具栏中的“我的图标”,android,toolbar,navigationbar,Android,Toolbar,Navigationbar,我已经实现了一个用于播放电影的Android应用程序。我对工具栏和导航栏有问题。请看下面的截图 您可以看到设置图标位于导航栏下,它无法按下。我需要将此图标移动到导航栏的左侧 我的活动风格如下 <style name="VideoActivityTheme" parent="Theme.AppCompat.Light.NoActionBar"> <item name="android:popupMenuStyle">@style/VideoPlayer.P

我已经实现了一个用于播放电影的Android应用程序。我对
工具栏
导航栏
有问题。请看下面的截图

您可以看到设置图标位于导航栏下,它无法按下。我需要将此图标移动到导航栏的左侧

我的活动风格如下

<style name="VideoActivityTheme" parent="Theme.AppCompat.Light.NoActionBar">
        <item name="android:popupMenuStyle">@style/VideoPlayer.PopupMenu</item>
        <item name="android:listPopupWindowStyle">@style/VideoPlayer.ListPopupWindow</item>
        <item name="android:actionBarStyle">@style/VideoPlayer.ActionBarStyle</item>
        <item name="android:windowActionBarOverlay">true</item>
        <item name="android:colorPrimaryDark" tools:ignore="NewApi">@color/black</item>
        <item name="android:windowDrawsSystemBarBackgrounds" tools:ignore="NewApi">false</item>
        <item name="android:windowTranslucentNavigation" tools:ignore="NewApi">true</item>
        <item name="android:windowTranslucentStatus" tools:ignore="NewApi">true</item>
</style>

<style name="VideoPlayer.ActionBarStyle" parent="@android:style/Widget.Holo.Light.ActionBar">
        <item name="android:titleTextStyle">@style/VideoPlayer.ActionBar.TitleTextStyle</item>
        <item name="android:icon">@android:color/transparent</item>
        <item name="android:displayOptions">showHome|homeAsUp|showTitle</item>
        <item name="displayOptions">showHome|homeAsUp|showTitle</item>
</style>
并使用工具栏进行布局:

<?xml version="1.0" encoding="utf-8"?>

<android.support.v7.widget.Toolbar
    android:id="@+id/toolbar"
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="?attr/actionBarSize"
    android:background="?attr/colorPrimary"
    android:elevation="4dp"
    android:theme="@style/ThemeOverlay.AppCompat.ActionBar"
/>

将此添加到您的风格中

<item name="android:fitsSystemWindows">true</item>


从您的抽屉布局中。

在添加工具栏时,您活动的xml看起来如何?@JasonSaruulo请查看我的更新。现在我的图标不在导航栏下,但视频不会覆盖整个屏幕。我的导航栏必须覆盖我的视频内容。你可以隐藏导航栏以获得全屏。查看此内容。您可以使用我已经在使用的标志来控制导航栏的可视性,这些标志在参考文章中提到过,以实现这一点。当我瞄准SDK版本18时,我没有这个问题。当我开始瞄准SDK版本22时,问题就出现了。
<item name="android:fitsSystemWindows">true</item>
android:fitsSystemWindows="false"
android:fitsSystemWindows="true"