FloatingActionButton is covered by the list in the fragment

The XML below is FloatingActionButton

covered by Linearlayout ll_urls2

as well lv_blockedURLs

.

Below is the code as the screenshot looks like. I would like to FloatingActionButton

be included in the TOP of the list - how to do this?

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout 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="wrap_content"
android:background="@color/bg_slidingpanes"
android:clickable="true"
android:orientation="vertical"
android:weightSum="1">


<LinearLayout
    android:id="@+id/ll_urls2"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:background="@color/bg_slidingpanes"
    android:orientation="vertical"
    android:visibility="visible">

    <ListView
        android:id="@+id/lv_blockedURLs"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:paddingLeft="25dp"
        android:paddingRight="15dp"></ListView>
</LinearLayout>

<LinearLayout
    android:id="@+id/ll_floatingactionbtn"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:orientation="vertical">

    <android.support.design.widget.FloatingActionButton
        android:id="@+id/flbtn_addNewURL"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"

        android:layout_gravity="right|bottom"

        android:layout_margin="16dp"
        android:clickable="true"

        android:src="@drawable/bg_plus"
        app:elevation="4dp"
        app:layout_anchorGravity="bottom|right|end" />


</LinearLayout>


<LinearLayout
    android:id="@+id/ll_floatingactionbtn"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:orientation="vertical">

    <android.support.design.widget.FloatingActionButton
        android:id="@+id/flbtn_addNewURL"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"

        android:layout_margin="16dp"

        app:elevation="4dp"
        android:clickable="true"

        android:layout_gravity="right|bottom"
        app:layout_anchorGravity="bottom|right|end"
        android:src="@drawable/bg_plus" />

</LinearLayout>
</LinearLayout>

      

As you can see below, is FloatingActionButton

missing. In fact, if I decrease the height ListView

, I can seeFloatingActionButton

enter image description here

+3


source to share


1 answer


This does not apply to ListViews. I'm pretty sure it's just off screen. Somewhere below the ListView



Use RelativeLayout for external layout

+2


source







All Articles