Удалить границу вокруг AppBarLayout - PullRequest
0 голосов
/ 02 июля 2018

У меня есть фрагмент, который выглядит так:

Screenshot

Прямо над розовой точкой и серой точкой, расположенными рядом друг с другом в нижней части экрана (прямо над нижней панелью навигации), расположена горизонтальная серая линия.

Могу ли я удалить его?

Фрагмент имеет следующий файл макета:

<?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>

Я посмотрел на этот пост: Удалить границу ActionBar

но, учитывая, что я не пытаюсь удалить границу из панели действий, я не думаю, что она применима.

Ответы [ 2 ]

0 голосов
/ 29 июля 2018

Установите app:elevation="0dp" в вашем AppBarLayout, как показано ниже:

<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">
0 голосов
/ 29 июля 2018

Может быть, это не граница, а просто тень под AppBarLayout. Вы можете использовать app: elevation = "0dp", чтобы удалить его

Источник: Удалить тень под виджетом AppBarLayout для Android

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...