2017-09-14 3 views
0

S'il vous plaît aidez-moi comment faire correspondre la bordure de la disposition de l'onglet avec Appbarlayout et terminer la ligne pour lui faire sentir unique. Pourquoi ma présentation d'onglet s'affiche-t-elle derrière l'Appbar?comment corriger l'élévation de la disposition des onglets dans l'onglet android fragment

C'est ma mise en page de l'onglet Capture d'écran:

enter image description here

Ceci est mon Tablayout xml

<?xml version="1.0" encoding="utf-8"?> 
<LinearLayout 
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:layout_width="match_parent" 
android:layout_height="match_parent" 
android:orientation="vertical" 
tools:context="com.example.ahsan.growupwork.ViewProjects"> 

    <android.support.design.widget.TabLayout 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content" 
     android:background="@color/random1" 
     app:tabMode="fixed" 
     app:tabGravity="fill" 
     android:id="@+id/tab_layout" 
     app:tabTextColor="@color/cardview_light_background" 
     app:tabIndicatorColor="@color/cardview_light_background" 
     app:tabIndicatorHeight="3dp" 
     android:elevation="0dp" 
     app:tabSelectedTextColor="@color/cardview_light_background" 
     /> 



<android.support.v4.view.ViewPager 
    android:layout_width="match_parent" 
    android:layout_height="wrap_content" 
    android:id="@+id/viewpager"/> 

</LinearLayout> 
+0

Utilisez android.support.design.widget.AppBarLayout et ajoutez l'application: élévation = "0DP" dans votre android.support.design.widget.AppBarLayout –

Répondre

1

vous devez augmenter l'élévation de votre tablayout: app:elevation="10dp" pour montrer que il est au-dessus de la barre d'outils mais si vous voulez l'enlever il suffit de changer la ligne

android:elevation="0dp"

à

app:elevation="0dp"

+0

ne fonctionne pas .. Fondamentalement, je veux le faire comme WhatsApp ui, les onglets et appbar ressemble à la même chose, –