Je voudrais savoir pourquoi cette barre d'outils a jeté une ombre que si NestedScrollView est là (j'ai cet exemple de l'Internet)Android: élévation de la barre d'outils/Shadow
<android.support.design.widget.CoordinatorLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent">
<android.support.v4.widget.NestedScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_behavior="@string/appbar_scrolling_view_behavior">
<!-- Your scrolling content -->
</android.support.v4.widget.NestedScrollView>
<android.support.design.widget.AppBarLayout
android:layout_height="wrap_content"
android:layout_width="match_parent">
<android.support.v7.widget.Toolbar
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:local="http://schemas.android.com/apk/res-auto"
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:minHeight="?attr/actionBarSize"
android:background="?attr/colorPrimary"
local:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"
local:popupTheme="@style/ThemeOverlay.AppCompat.Light"
/>
</android.support.design.widget.AppBarLayout>
</android.support.design.widget.CoordinatorLayout>
Cette barre d'outils (sans NestedScrollView) ne pas lancer l'ombre:
<android.support.design.widget.CoordinatorLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent">
<android.support.design.widget.AppBarLayout
android:layout_height="wrap_content"
android:layout_width="match_parent">
<android.support.v7.widget.Toolbar
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:local="http://schemas.android.com/apk/res-auto"
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:minHeight="?attr/actionBarSize"
android:background="?attr/colorPrimary"
local:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"
local:popupTheme="@style/ThemeOverlay.AppCompat.Light"
/>
</android.support.design.widget.AppBarLayout>
</android.support.design.widget.CoordinatorLayout>
Je peux poster des photos, si nécessaire, mais je n'ai aucune idée pourquoi cela se produise. C'est ce que je l'ai essayé jusqu'à présent:
- Réglage clipToPadding = "false" sur le parent disposition linéaire
- élévation Configuration manuelle (mon appareil n'est pas pré-Lollipop)
- Seting outlineProvider = » les bornes » dans la vue
- Réglage android: hardwareAccelerated = "true" sur le AndroidManifest.xml
Edit: Je l'ai résolu en utilisant la balise. Vérifiez ma réponse avec le code.
Veuillez envoyer l'image que vous voulez réaliser et ce que vous obtenez avec votre code. Je t'aiderai. –
@AmrishKakadiya Lire ma réponse, j'ai déjà réussi à le réparer, mais je peux poster des photos quand même. Et merci d'offrir votre aide: D –
Super, pas besoin de poster une image. –