ステータスバーの色に問題がありますandroid:fitsSystemWindows="false"
Androidステータスバーの色
透明になります。私はそれが起こることを望んでいない。その色にはcolorPrimaryDark
があります。
は私がメインのレイアウトでFrameLayout
を使用していますので、android:fitsSystemWindows="false"
は、オーバーレイは画面全体を占有するtrue
に設定されている場合、私は、オーバーレイフラグメントを膨らませることができるようにfalse
としてこれを設定する必要があり、私はそれがオーバーレイフラグメントで発生したくありません。
私のactivity_mainはこのようになります。
<?xml version="1.0" encoding="utf-8"?>
<android.support.v4.widget.DrawerLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:background="@drawable/layout_bg_white"
android:id="@+id/drawer_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="false"
tools:openDrawer="start"
tools:context="com.example.tabstrial2.MainActivity">
<RelativeLayout
android:id="@+id/main_layout_of_app"
android:layout_width="match_parent"
android:layout_height="match_parent">
</RelativeLayout>
<FrameLayout
android:id="@+id/overlay_fragment_container"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginBottom="56dp"
android:layout_marginLeft="8dp"
android:layout_marginRight="8dp"
android:layout_marginTop="119dp" />
</android.support.v4.widget.DrawerLayout>
style.xmlは次のようになります。
<resources>
<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
<!-- Customize your theme here. -->
<item name="colorPrimary">#500347</item>
<item name="colorPrimaryDark">#862b7b</item>
<item name="colorAccent">#1a2fcf</item>
<item name="android:textColor">#ffffff</item>
<item name="colorControlHighlight">#fff</item>
<item name="colorControlActivated">@android:color/holo_green_dark</item>
<item name="colorControlNormal">#fff</item> <!-- normal border color change as you wish -->
<item name="colorButtonNormal">#500347</item>
</style>
<style name="AppTheme.NoActionBar">
<item name="windowActionBar">false</item>
<item name="windowNoTitle">true</item>
</style>
<style name="AppTheme.AppBarOverlay" parent="ThemeOverlay.AppCompat.Dark.ActionBar" />
<style name="AppTheme.PopupOverlay" parent="ThemeOverlay.AppCompat.Light" />
<style name="AppTheme.Picker" parent="Theme.AppCompat.Light.NoActionBar">
<item name="android:textColorPrimary">@android:color/white</item>
</style>
<!--<style name="AppTheme.CheckBox" parent="Theme.AppCompat.Light.NoActionBar">-->
<!--<item name="android:colorAccent">@android:color/white</item>-->
<!--</style>-->
<style name="MyCheckBox" parent="Theme.AppCompat.NoActionBar">
<item name="colorControlNormal">#fff
</item> <!-- normal border color change as you wish -->
<item name="colorControlActivated">#fff</item> <!-- activated color change as you wish -->
<item name="android:textColor">#FFFF3F3C</item> <!-- checkbox text color -->
</style>
あなたのテーマをアクティビティに使用してください。 –
@MujammilAhamed、質問のstyle.xmlを追加しました。 –
ちょうどこのチュートリアル(http://www.androidhive.info/2015/04/android-getting-started-with-material-design/)に従ってください、それはあなたを助けるかもしれません.. – parthi