Фрагмент под панелью инструментов - PullRequest
0 голосов
/ 24 сентября 2018

Я никогда не использовал меню + fab в своих проектах раньше.Итак, я сделал 3 фрагмента вкладок и все 3 показывает просмотр списка, но мои фрагменты находятся под панелью инструментов

Вот код - фрагмент.xml

<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout
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">

<TextView
    android:id="@+id/heading"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:paddingLeft="14dp"
    android:paddingTop="16dp"
    android:text="VEHICLES REQUESTED"
    android:textColor="#88bf40"
    android:textStyle="bold"/>

<ListView
    android:id="@+id/vehicle_LV"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"/>

</android.support.constraint.ConstraintLayout>

Я использую его или первыйвремя с потрясающей навигацией и меню, пожалуйста, дайте мне знать, если я что-то не так здесьправильный способ решения этого.У кого-нибудь есть идеи, что делать?

ScreenShot - здесь

Ответы [ 3 ]

0 голосов
/ 28 сентября 2018

Попробуйте добавить эту строку в AppBarLayout

android:layout_gravity="bottom"
0 голосов
/ 18 октября 2018

Это для всех остальных людей, которые ищут ответы на тот же вопрос.

Таким образом, проблема была с моей темой, по умолчанию было установлено отсутствие панели действий.Поэтому я изменил это на тему с панелью действий.

Вот код, который я добавил в свой xml.

android:theme="@style/AppTheme"

, а вот код, который я добавил в мой файл styles.xml.

<style name="AppTheme" parent="Base.Theme.AppCompat.Light.DarkActionBar">
    <!-- Customize your theme here. -->
    <item name="colorPrimary">@color/colorPrimary</item>
    <item name="colorPrimaryDark">@color/colorPrimaryDark</item>
    <item name="colorAccent">@color/colorAccent</item>
</style>
0 голосов
/ 24 сентября 2018

Я думаю, что этот атрибут поможет вам

layout_constraintTop_toBottomOf

использование:

   <android.support.v4.view.ViewPager
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    app:layout_constraintTop_toBottomOf="@+id/toolbar"
    android:id="@+id/viewPager"/>
Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...