3

Ребилд делал,кэш чистил,ошибок в редакторе нет. использую navigationview.

Код activity_main:

<android.support.v4.widget.DrawerLayout 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:id="@+id/drawer_layout"

    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:fitsSystemWindows="true"
    tools:openDrawer="start">

    <include
        layout="@layout/app_bar_main"
        android:layout_width="match_parent"
        android:layout_height="match_parent" />

    <android.support.design.widget.NavigationView
        android:layout_marginTop="5dp"
        android:id="@+id/nav_view"
        android:layout_width="250dp"
        android:layout_height="match_parent"
        android:layout_gravity="start"
        android:fitsSystemWindows="true"
        android:padding="5dp"
        android:background="@color/colorBacgroundContent"
        app:headerLayout="@layout/nav_header_main"
        app:menu="@menu/activity_main_drawer" />

</android.support.v4.widget.DrawerLayout>

Код app_bar_main:

<android.support.design.widget.CoordinatorLayout 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:background="@color/colorBacgroundContent"
android:fitsSystemWindows="true"
tools:context="com.handlingcitizen.handlingcitizen.MainActivity">


<com.roughike.bottombar.BottomBar
    android:id="@+id/bottomBar"
    android:layout_width="match_parent"
    android:layout_height="60dp"
    android:layout_gravity="bottom"
    app:bb_activeTabColor="@color/colorBacgroundContent"


    app:bb_inActiveTabAlpha="0.8"
    app:bb_inActiveTabColor="@color/colorBacgroundContent"
    app:bb_showShadow="true"
    app:bb_tabXmlResource="@xml/bottombar_tabs"/>

<android.support.design.widget.AppBarLayout
    android:layout_width="match_parent"

    android:layout_height="wrap_content"
    android:animateLayoutChanges="true"
    android:theme="@style/AppTheme.AppBarOverlay">

    <android.support.v7.widget.Toolbar
        android:id="@+id/toolbar"

        android:layout_width="match_parent"
        android:layout_height="?attr/actionBarSize"
        android:background="?attr/colorPrimary"
        app:layout_scrollFlags="scroll|enterAlways"
        app:popupTheme="@style/AppTheme.PopupOverlay"/>

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

<android.support.design.widget.FloatingActionButton
    android:id="@+id/fab"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_gravity="bottom|end"
    android:layout_marginBottom="70dp"
    android:layout_marginEnd="20dp"
    android:visibility="visible"

    app:srcCompat="@android:drawable/ic_dialog_email"/>
<include layout="@layout/content_main"/>

введите сюда описание изображения введите сюда описание изображения

3
  • 2
    Попробуйте <include layout="@layout/content_main"/> поставить перед FloatingActionButton. Думается мне у вас контент перекрывает кнопку.
    – lllyct
    25 ноя 2016 в 12:17
  • @ lllyct спасибо!!!!
    – upward
    25 ноя 2016 в 12:19
  • Продублировал в ответы, раз уж это помогло.
    – lllyct
    25 ноя 2016 в 12:29

1 ответ 1

4

Нужно поменять местами контент и кнопку, т.к. контент перекрывает эту самую кнопку:

<include layout="@layout/content_main"/>

<android.support.design.widget.FloatingActionButton
    android:id="@+id/fab"
    ...
    app:srcCompat="@android:drawable/ic_dialog_email"/>

Ваш ответ

By clicking “Отправить ответ”, you agree to our terms of service and acknowledge you have read our privacy policy.

Всё ещё ищете ответ? Посмотрите другие вопросы с метками или задайте свой вопрос.