【问题标题】:Toolbar hidden by noification pannel通知面板隐藏的工具栏
【发布时间】:2015-05-29 14:31:41
【问题描述】:

所以我已经生成了 apk,但是当我启动我的应用程序时,工具栏被通知面板隐藏: android.support.v7.widget.Toolbar

工具栏.xml:

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

<android.support.v7.widget.Toolbar
    xmlns:local="http://schemas.android.com/apk/res-auto"
    android:id="@+id/main_toolbar"
    android:layout_width="match_parent"
    android:layout_height="50px"
    android:background="#263355"
    local:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"
    local:popupTheme="@style/ThemeOverlay.AppCompat.Light"
    xmlns:android="http://schemas.android.com/apk/res/android">

    <LinearLayout
        android:id="@+id/main_toolbar_layout"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:gravity="center"
        android:orientation="vertical">

        <TextView
            android:id="@+id/main_toolbar_title"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:textColor="#ffffff"
            android:textSize="16sp"
            android:textIsSelectable="false"
            android:textAlignment="center"
            android:layout_marginRight="24dp" />

    </LinearLayout>

</android.support.v7.widget.Toolbar>

AndroidManifest:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="package" >
    <uses-permission android:name="android.permission.INTERNET" />
    <application
        android:allowBackup="true"
        android:icon="@mipmap/ic_launcher_solutis"
        android:label="@string/app_name"
        android:theme="@style/AppTheme" >
        <activity
            android:name=".Splashscreen"
            android:label="@string/app_name" >
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
        <activity
            android:name=".MainActivity"
            android:label="@string/app_name" >
            <intent-filter>
                <action android:name="android.intent.action.ACCUEIL" />
                <category android:name="android.intent.category.DEFAULT" />
            </intent-filter>
        </activity>
    </application>
</manifest>

值/style.xml:

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

    <style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
    </style>

</resources>

价值观-v19:

<?xml version="1.0" encoding="utf-8"?>
<resources>
    <!-- Base application theme. -->
    <style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
        <!-- Customize your theme here. -->
        <item name="android:windowTranslucentStatus">true</item>
    </style>
</resources>

我在 HTC One 设备上,但如果认为它不是我使用的设备...

【问题讨论】:

  • 显然你使用了错误的主题...
  • @Selvin 为什么主题是错误的?那么我应该使用什么?
  • 显示你的 androidmanifest.xml 和 style.xml(如果你有几个)

标签: java android android-studio apk toolbar


【解决方案1】:

我认为你应该删除这一行:

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

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2018-06-12
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-04-02
    • 2018-02-22
    相关资源
    最近更新 更多