1
resposta

FAB não se move quando tento arrastar

Estou usando o Android Studio 3.6.2 Quando tento arrastar o FAB ele volta ao lugar inicial e o FAB é inserido no escopo da ListView.

Antes de mover o FAB o código XML é esse

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout 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">
    <com.google.android.material.floatingactionbutton.FloatingActionButton
        android:id="@+id/floatingActionButton"
        android:layout_width="93dp"
        android:layout_height="155dp"
        android:clickable="true"
        app:srcCompat="@mipmap/ic_launcher" />

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


    </ListView>


</RelativeLayout>

depois fica:

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout 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">

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


        <com.google.android.material.floatingactionbutton.FloatingActionButton
            android:id="@+id/floatingActionButton"
            android:layout_width="93dp"
            android:layout_height="155dp"
            android:clickable="true"
            app:srcCompat="@mipmap/ic_launcher" />
    </ListView>


</RelativeLayout>
1 resposta

Oi Carlos, tudo bem? As vezes o editor visual não funciona muito bem mesmo, por isso que saber editar o XML diretamente é sempre importante. Esse tipo de coisa acontece.