J'ai la disposition suivante:Premier élément RecyclerView ne va pas sous la barre d'état
<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
tools:context="com.skillberg.weather.ui.activity.MainActivity">
<android.support.v7.widget.RecyclerView
android:id="@+id/weather_rv"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@android:color/white"
android:fitsSystemWindows="true" />
</android.support.design.widget.CoordinatorLayout>
et le style:
<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
<!-- Customize your theme here. -->
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item>
<item name="windowActionBar">false</item>
<item name="windowNoTitle">true</item>
<item name="windowActionBarOverlay">true</item>
<item name="android:statusBarColor">@android:color/transparent</item>
</style>
Je veux que le premier élément de RecyclerView à afficher sous la barre d'état (comme la barre d'outils), mais il est pas là affiché:
Cependant, RecyclerView se dessine sous la barre d'état, mais il semble qu'il y ait une certaine rembourrage supérieure dont la hauteur = hauteur de la barre d'état:
Comment résoudre ce problème?
supprimer android: fitsSystemWindows = « true » de RecyclerView –
@VinayakB si je le supprimer, il positionne en dessous de la barre d'état: https://i.imgur.com/RFySVcx.jpg – arts777
pourquoi ne pas vous ajoutez- true
dans votre style –