1

I have a fragment which looks like this:

Screenshot

Right above the pink dot and the gray dot that are adjacent to each other at the bottom of the screen (right above the bottom navigation bar), there is a horizontal grey line.

Is there anyway I can remove it?

The fragment has the following layout file:

<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout 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"
xmlns:app="http://schemas.android.com/apk/res-auto"
tools:context=".home.tutorial.TutorialFragment">



<android.support.v4.view.ViewPager
    android:id="@+id/tutorialViewPager"
    android:layout_width="match_parent"
    android:layout_height="0dp"
    app:layout_constraintLeft_toLeftOf="parent"
    app:layout_constraintRight_toRightOf="parent"
    app:layout_constraintTop_toTopOf="parent"
    app:layout_constraintBottom_toTopOf="@+id/appBar"
    android:background="@android:color/white"/>

<android.support.design.widget.AppBarLayout
    android:id="@+id/appBar"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:background="@android:color/white"
    app:layout_constraintTop_toBottomOf="@id/tutorialViewPager"
    app:layout_constraintBottom_toBottomOf="parent"
    app:layout_constraintLeft_toLeftOf="parent"
    app:layout_constraintRight_toRightOf="parent">

    <me.relex.circleindicator.CircleIndicator
        android:id="@+id/circleIndicator"
        android:layout_width="match_parent"
        android:layout_height="48dp"
        app:ci_drawable="@drawable/tab_indicator_selected"
        app:ci_drawable_unselected="@drawable/tab_indicator_default"
        app:ci_height="6dp"
        app:ci_width="6dp"
        app:layout_constraintTop_toTopOf="parent"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintRight_toRightOf="parent"
        app:layout_constraintLeft_toLeftOf="parent"/>


</android.support.design.widget.AppBarLayout>

</android.support.constraint.ConstraintLayout>

I looked at this post: Remove ActionBar Border

but considering I'm not trying to remove a border from the action bar, I don't think it is applicable.

Foobar
  • 7,458
  • 16
  • 81
  • 161

2 Answers2

10

Set app:elevation="0dp" in your AppBarLayout as below:

<android.support.design.widget.AppBarLayout
    android:id="@+id/appBar"
    app:elevation="0dp"                          <-- Add this line
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:background="@android:color/white"
    app:layout_constraintTop_toBottomOf="@id/tutorialViewPager"
    app:layout_constraintBottom_toBottomOf="parent"
    app:layout_constraintLeft_toLeftOf="parent"
    app:layout_constraintRight_toRightOf="parent">
Gokul Nath KP
  • 15,485
  • 24
  • 88
  • 126
0

Maybe it's not border but just the shadow below the AppBarLayout. You can use app:elevation="0dp" to remove it

Source : remove shadow below AppBarLayout widget android

Nearyuk
  • 167
  • 2
  • 12