【发布时间】:2017-02-04 21:18:13
【问题描述】:
我正在使用 AppCompat 设计我的 android 移动应用程序。 它运行的是 API 23 的 android 6.0。
这是我的 AndroidManifest.xml:
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="FeedingTime.FeedingTime" android:versionCode="1" android:versionName="1.0" android:installLocation="auto">
<uses-sdk />
<application android:icon="@drawable/Icon" android:label="Feeding Time" android:theme="@style/AppTheme">
</application>
</manifest>
这是我的 style.xml:
<style name="AppTheme" parent="Theme.AppCompat.Light">
<item name="android:windowTranslucentStatus">true</item>
<item name="android:windowBackground">@color/background_color</item>
<item name="colorPrimary">#6497b1</item>
<item name="colorPrimaryDark">#005b96</item>
</style>
这是存在问题的 Activity 布局的 XML:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true">
<include
android:id="@+id/toolbarHistoryActivity"
layout="@layout/toolbar" />
<ListView
android:minWidth="25px"
android:minHeight="25px"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="4"
android:id="@+id/listViewHistory" />
<Button
android:text="Clear History"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:id="@+id/btnClearHistory" />
</LinearLayout>
我遇到了一个问题,在主屏幕活动中,状态栏颜色按预期设置为深蓝色,但是当我打开第二个活动时,我的状态栏改变颜色,它不再使用“colorPrimaryDark”而是我在“windowBackground”中的颜色较深的版本。
这是为什么呢?
【问题讨论】:
-
同时发布您的清单文件!
标签: android xamarin android-appcompat