¿Cómo configurar correctamente el botón de acción flotante?

Tengo un problema. Utilicé esta biblioteca para hacer el panel deslizante. Haga clic aquí . Lo agregué y luego intenté hacer el botón de acción flotante como en la aplicación de mapa de google. (Como en la imagen). Introduzca aquí la descripción de la imagen

Pero aquí abajo mi resultado. Cómo configurar (hacer que la parte superior del panel deslizante trasprent pueda ser) correctamente como en la 1ª imagen.

Introduzca aquí la descripción de la imagen

Fragment_1.xml (Comprobación de la parte de diseño deslizante)

<?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent"> <com.sothree.slidinguppanel.SlidingUpPanelLayout xmlns:sothree="http://schemas.android.com/apk/res-auto" android:id="@+id/sliding_layout" android:layout_width="match_parent" android:layout_height="match_parent" android:gravity="bottom" sothree:umanoPanelHeight="56dp" sothree:umanoShadowHeight="4dp" sothree:umanoParalaxOffset="50dp" sothree:umanoDragView="@+id/dragView" xmlns:fab="http://schemas.android.com/apk/res-auto"> <!-- MAIN CONTENT --> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" android:weightSum="100"> </LinearLayout> <!-- SLIDING LAYOUT --> <LinearLayout android:layout_width="match_parent" android:layout_height="390dp" android:background="@android:color/transparent" android:orientation="vertical" android:clickable="true" android:focusable="false" sothree:umanoOverlay="true" android:layout_below="@+id/main_content"> <!-—TOP OF PANEL --> <LinearLayout android:layout_width="match_parent" android:layout_height="56dp" android:orientation="horizontal" android:background="#03A9F4" android:id="@+id/dragView"> <TextView android:id="@+id/name" android:layout_width="0dp" android:layout_height="match_parent" android:layout_weight="1" android:textSize="14sp" android:gravity="center_vertical" android:paddingLeft="10dp" android:textColor="@android:color/white"/> <Button android:id="@+id/follow" android:layout_width="wrap_content" android:layout_height="match_parent" android:textSize="14sp" android:gravity="center_vertical|right" android:paddingRight="10dp" android:paddingLeft="10dp"/> <com.melnykov.fab.FloatingActionButton android:id="@+id/fab" sothree:fab_type="normal" android:layout_marginBottom="25dp" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="bottom|right|center" android:tint="@android:color/white" android:src="@android:drawable/ic_dialog_map" fab:fab_colorNormal="@color/fab_primary" fab:fab_colorPressed="@color/fab_pressed" fab:fab_colorRipple="@color/fab_ripple"/> </LinearLayout> </LinearLayout> </com.sothree.slidinguppanel.SlidingUpPanelLayout> </RelativeLayout> 

¡Gracias por cualquier ayuda!

<com.melnykov.fab.FloatingActionButton/> el <com.melnykov.fab.FloatingActionButton/> fuera del <com.sothree.slidinguppanel.SlidingUpPanelLayout/> y no olvide ubicarlo usando marginTop y marginLeft:

 <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:sothree="http://schemas.android.com/apk/res-auto" xmlns:fab="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent"> <com.sothree.slidinguppanel.SlidingUpPanelLayout xmlns:sothree="http://schemas.android.com/apk/res-auto" android:id="@+id/sliding_layout" android:layout_width="match_parent" android:layout_height="match_parent" android:gravity="bottom" sothree:umanoPanelHeight="56dp" sothree:umanoShadowHeight="4dp" sothree:umanoParalaxOffset="50dp" sothree:umanoDragView="@+id/dragView" xmlns:fab="http://schemas.android.com/apk/res-auto"> <!-- MAIN CONTENT --> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" android:weightSum="100"> </LinearLayout> <!-- SLIDING LAYOUT --> <LinearLayout android:layout_width="match_parent" android:layout_height="390dp" android:background="@android:color/transparent" android:orientation="vertical" android:clickable="true" android:focusable="false" sothree:umanoOverlay="true" android:layout_below="@+id/main_content"> <!--—TOP OF PANEL --> <LinearLayout android:layout_width="match_parent" android:layout_height="56dp" android:orientation="horizontal" android:background="#03A9F4" android:id="@+id/dragView"> <TextView android:id="@+id/name" android:layout_width="0dp" android:layout_height="match_parent" android:layout_weight="1" android:textSize="14sp" android:gravity="center_vertical" android:paddingLeft="10dp" android:textColor="@android:color/white"/> <Button android:id="@+id/follow" android:layout_width="wrap_content" android:layout_height="match_parent" android:textSize="14sp" android:gravity="center_vertical|right" android:paddingRight="10dp" android:paddingLeft="10dp"/> </LinearLayout> </LinearLayout> </com.sothree.slidinguppanel.SlidingUpPanelLayout> <com.melnykov.fab.FloatingActionButton android:id="@+id/fab" sothree:fab_type="normal" android:layout_marginBottom="25dp" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="bottom|right|center" android:tint="@android:color/white" android:src="@android:drawable/ic_dialog_map" android:layout_marginLeft="300dp" android:layout_marginTop="200dp" fab:fab_colorNormal="@color/fab_primary" fab:fab_colorPressed="@color/fab_pressed" fab:fab_colorRipple="@color/fab_ripple"/> </RelativeLayout> 

Una manera más fácil, que es lo que hice, es simplemente añadir un relleno de 28 dp al primer elemento en el diseño deslizante y poner el SlidingLayout en el modo de superposición.

 <com.sothree.slidinguppanel.SlidingUpPanelLayout android:id="@+id/sliding_layout" xmlns:android="http://schemas.android.com/apk/res/android" xmlns:fab="http://schemas.android.com/apk/res-auto" xmlns:sothree="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:gravity="bottom" sothree:umanoOverlay="true" sothree:umanoPanelHeight="228dp" sothree:umanoShadowHeight="0dp" tools:context="com.myfab5.mobile.myfab5.ui.BusinessActivityFragment" tools:ignore="RtlHardcoded"> <com.google.android.gms.maps.MapView android:id="@+id/map_view" android:layout_width="match_parent" android:layout_height="match_parent" /> <RelativeLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:background="@color/transparent"> <ImageView android:id="@+id/header_image" android:layout_width="match_parent" android:layout_height="200dp" android:layout_alignParentTop="true" android:layout_marginTop="28dp" /> <com.melnykov.fab.FloatingActionButton android:id="@+id/directions_button" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentRight="true" android:layout_alignParentTop="true" android:layout_marginRight="@dimen/full_margin" android:elevation="@dimen/quarter_margin" android:src="@drawable/ic_directions_white_24dp" fab:fab_colorNormal="@color/accent" fab:fab_colorPressed="@color/accent_60" fab:fab_colorRipple="@color/accent_60" /> <TextView android:id="@+id/text_view" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentLeft="true" android:layout_alignParentTop="true" android:layout_marginBottom="@dimen/triple_margin" android:layout_marginLeft="@dimen/full_margin" android:layout_marginTop="@dimen/quadruple_margin" android:text="@string/business_name" android:textColor="@color/white" android:textSize="24sp" /> </RelativeLayout> 

  • Volver a llamar a Android después de que se haya completado la representación de diseño?
  • Imagen GridView Fragmento interior
  • Fragmento colocado encima de NavigationDrawer
  • Android - Cómo cambiar dinámicamente el diseño del fragmento
  • Google Maps en Android: No se pudo encontrar el estilo 'mapViewStyle' en el tema actual
  • Android CalendarView desaceleración de diseño
  • Android crea un "botón plano"
  • ¿Cuál es el equivalente de "colspan" en un Android TableLayout?
  • Android emulador de AVD en Eclipse muestra pantalla en negro y "android"
  • Cómo ver datos detallados de un elemento de vista de lista específico
  • Cómo crear un menú de barra lateral
  • FlipAndroid es un fan de Google para Android, Todo sobre Android Phones, Android Wear, Android Dev y Aplicaciones para Android Aplicaciones.