Line coming between toolbar and Tabs

后端 未结 5 1559
隐瞒了意图╮
隐瞒了意图╮ 2021-01-19 04:34

How to remove the deep line between the toolbar and tablayout, I searched on the google someone said , add some elevation to the toolbar and tablayout ,I did but it not work

相关标签:
5条回答
  • 2021-01-19 05:09

    I had the same problem, i was using android:elevation="0dp" but it didn't work. To the AppBarLayout in xml, set app:elevation="0dp" instead of android:elevation="0dp".

    0 讨论(0)
  • 2021-01-19 05:12

    I try all the above methods but no one work for me !

    Then i simply remove the AppBarLayout Widget from xml. It solve my problem

    Causes Problem

     <android.support.design.widget.AppBarLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        app:elevation="0dp">
    
        <android.support.v7.widget.Toolbar
            android:id="@+id/toolbar"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:background="@color/app_theme_black_color"
            local:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar" />
    </android.support.design.widget.AppBarLayout>
    

    Solved Problem (Just remove the AppBarLayout)

        <android.support.v7.widget.Toolbar
            android:id="@+id/toolbar"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:background="@color/app_theme_black_color"
            local:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar" />
    

    Share to improve.

    0 讨论(0)
  • 2021-01-19 05:14

    Remove your Relative Layouts and put the TabLayout inside the appbarlayout, below the toolbar, and remove all of the elevation people suggested to add. This is the right way to do it. If it doesn't work for you, I'll be glad to help.

    0 讨论(0)
  • 2021-01-19 05:14

    Go to toolbar and set app:elevation="0dp" only in toolbar and app bar layout. Everything will work fine.

    0 讨论(0)
  • 2021-01-19 05:27

    I had same problem and used android:elevation="0dp" and app:elevation="0dp" but problem not solved.Then i changed the elevation of toolbar dynamically.By using this

    getSupportActionBar().setElevation(0);
    

    and it worked for me.

    0 讨论(0)
提交回复
热议问题