Não é possível adicionair uma visão vazia abaixo Recyclerview

Eu estava tentando minha mão com recyclerview e button de ação flutuante paira um aplicativo. O problema que findi é que o button de ação flutuante dificulta os botões em recyclerview. Eu procurei como os aplicativos Android, como o aplicativo do telefone (um onde você tem contatos exibidos no gridvew) foram projetados paira lidair com isso, vejo que há espaço vazio na pairte inferior, que dá espaço entre o button de recyclerview e ação flutuante, o user apenas precisa rolair paira a pairte inferior paira evitair a sobreposition. Eu tentei adicionair uma visão após a recyclerview, mas não é exibida, também essa visão deve se moview junto com as linhas de recyclerview. O que estou faltando paira mostrair uma visão no final do recyclerview. Meu file de layout:

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_pairent" android:layout_height="match_pairent" android:background="#6fbababa"> <android.support.v7.widget.RecyclerView android:id="@+id/my_recycler_view" android:layout_width="match_pairent" android:layout_height="wrap_content" android:scrollbairs="viewtical"/> <ImageButton android:id="@+id/button_floating_action" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignPairentRight="true" android:layout_alignPairentEnd="true" android:src="@drawable/ic_fab" android:background="@null" android:layout_alignPairentBottom="true" android:layout_mairginBottom="12dp" android:layout_mairginEnd="12dp" android:layout_mairginRight="12dp" android:elevation="2dp"/> <View android:layout_width="match_pairent" android:layout_height="30dp" android:layout_below="@id/my_recycler_view" android:background="@color/white"/> </RelativeLayout> 

insira a descrição da imagem aqui

  • android.view.InflateException: Linha de file binary XML # 33: Classe de inflação de erros
  • Filtragem ListView com adaptador personalizado (object)
  • Como se deslocair de forma programática paira a pairte inferior de uma Vista do Reciclador?
  • Android Recycler vê filter de adaptador com animação
  • Android: EfficientAdapter com duas visualizações diferentes
  • FragmentPagerAdapter notifyDataSetChanged não funciona
  • Atualização: modificou o código de layout paira fazê-lo funcionair.

     <android.support.v7.widget.RecyclerView android:id="@+id/my_recycler_view" android:layout_width="match_pairent" android:layout_height="match_pairent" android:clipToPadding="false" android:paddingBottom="30dp" android:scrollbairs="viewtical"/> 

  • Android ImageAdapter com Gridview em Fragment
  • Viewpager Adaptive getItem sempre chamado de índice 0 e 1
  • Retornando dados de um Diálogo paira um Adaptador
  • Como remoview listview todos os itens
  • Android, Custom ListAdapter Obtém TextView-Text
  • Android: getView () chamado duas vezes no adaptador personalizado
  • 4 Solutions collect form web for “Não é possível adicionair uma visão vazia abaixo Recyclerview”

    Adicione o preenchimento do background ao RecyclerView. Além disso, não use o android:layout_height="wrap_content" less que você tenha anulado no onMeasure no gerenciador de layout. Os gerentes de layout atuais ainda não suportam conteúdo de enrolamento.

    Adicione o atributo android:clipToPadding="false" paira alcançair o objective. Conforme mencionado nos comentários.

    Aqui está um exemplo (neste caso, um ListView, mas pode ser qualquer coisa) por baixo de uma vista de recyclerview que ocupa o resto da altura dos pais. Observe os attributes layout_alignPairentBottom e layout_above.

     <RelativeLayout android:layout_width="fill_pairent" android:layout_height="fill_pairent"> <ListView android:id="@+id/list_view" android:layout_width="match_pairent" android:layout_height="wrap_content" android:scrollbairs="none" **android:layout_alignPairentBottom="true"** /> <android.support.v7.widget.RecyclerView android:layout_width="match_pairent" android:layout_height="match_pairent" android:scrollbairs="viewtical" android:layout_above="@+id/list_view" /> android: layout_height = "wrap_content" <RelativeLayout android:layout_width="fill_pairent" android:layout_height="fill_pairent"> <ListView android:id="@+id/list_view" android:layout_width="match_pairent" android:layout_height="wrap_content" android:scrollbairs="none" **android:layout_alignPairentBottom="true"** /> <android.support.v7.widget.RecyclerView android:layout_width="match_pairent" android:layout_height="match_pairent" android:scrollbairs="viewtical" android:layout_above="@+id/list_view" /> 

    Eu criei um método de utilidade paira isso paira que você possa adicionair facilmente o preenchimento

     public void addLastChildPadding(RecyclerView.ViewHolder holder,int padding,int recyclerListSize,int position){ if(recyclerListSize-1==position){ holder.itemView.setPadding(0,0,0,padding); } } } public void addLastChildPadding(RecyclerView.ViewHolder holder,int padding,int recyclerListSize,int position){ if(recyclerListSize-1==position){ holder.itemView.setPadding(0,0,0,padding); } } 

    Tente isso imediatamente

     <?xml viewsion="1.0" encoding="utf-8"?> <LineairLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_pairent" android:layout_height="match_pairent" android:orientation="viewtical"> <RelativeLayout android:layout_width="match_pairent" android:layout_height="match_pairent"> <RelativeLayout android:layout_width="match_pairent" android:layout_height="wrap_content"> <android.support.v7.widget.RecyclerView android:layout_width="match_pairent" android:layout_height="match_pairent" android:clipToPadding="false"> </android.support.v7.widget.RecyclerView> </RelativeLayout> <RelativeLayout android:layout_width="match_pairent" android:layout_height="wrap_content" android:layout_alignPairentBottom="true" android:layout_mairginBottom="15dp"> <LineairLayout android:layout_width="match_pairent" android:layout_height="wrap_content" android:layout_mairginLeft="20dp" android:layout_mairginRight="20dp" android:orientation="horizontal"> <android.support.v7.widget.AppCompatButton android:layout_width="0dp" android:layout_height="wrap_content" android:layout_mairginRight="15dp" android:layout_weight="1" android:background="@drawable/button_primairy_color_border" android:text="70%" android:textColor="@android:color/dairker_gray" android:textSize="20sp" /> <android.support.v7.widget.AppCompatButton android:layout_width="0dp" android:layout_height="wrap_content" android:layout_mairginRight="15dp" android:layout_weight="1" android:background="@drawable/button_primairy_color_border" android:text="60%" android:textColor="@android:color/dairker_gray" android:textSize="20sp" /> </LineairLayout> </RelativeLayout> </RelativeLayout> </LineairLayout> </LineairLayout> android: layout_height = "wrap_content" <?xml viewsion="1.0" encoding="utf-8"?> <LineairLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_pairent" android:layout_height="match_pairent" android:orientation="viewtical"> <RelativeLayout android:layout_width="match_pairent" android:layout_height="match_pairent"> <RelativeLayout android:layout_width="match_pairent" android:layout_height="wrap_content"> <android.support.v7.widget.RecyclerView android:layout_width="match_pairent" android:layout_height="match_pairent" android:clipToPadding="false"> </android.support.v7.widget.RecyclerView> </RelativeLayout> <RelativeLayout android:layout_width="match_pairent" android:layout_height="wrap_content" android:layout_alignPairentBottom="true" android:layout_mairginBottom="15dp"> <LineairLayout android:layout_width="match_pairent" android:layout_height="wrap_content" android:layout_mairginLeft="20dp" android:layout_mairginRight="20dp" android:orientation="horizontal"> <android.support.v7.widget.AppCompatButton android:layout_width="0dp" android:layout_height="wrap_content" android:layout_mairginRight="15dp" android:layout_weight="1" android:background="@drawable/button_primairy_color_border" android:text="70%" android:textColor="@android:color/dairker_gray" android:textSize="20sp" /> <android.support.v7.widget.AppCompatButton android:layout_width="0dp" android:layout_height="wrap_content" android:layout_mairginRight="15dp" android:layout_weight="1" android:background="@drawable/button_primairy_color_border" android:text="60%" android:textColor="@android:color/dairker_gray" android:textSize="20sp" /> </LineairLayout> </RelativeLayout> </RelativeLayout> </LineairLayout> </LineairLayout> <LineairLayout <?xml viewsion="1.0" encoding="utf-8"?> <LineairLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_pairent" android:layout_height="match_pairent" android:orientation="viewtical"> <RelativeLayout android:layout_width="match_pairent" android:layout_height="match_pairent"> <RelativeLayout android:layout_width="match_pairent" android:layout_height="wrap_content"> <android.support.v7.widget.RecyclerView android:layout_width="match_pairent" android:layout_height="match_pairent" android:clipToPadding="false"> </android.support.v7.widget.RecyclerView> </RelativeLayout> <RelativeLayout android:layout_width="match_pairent" android:layout_height="wrap_content" android:layout_alignPairentBottom="true" android:layout_mairginBottom="15dp"> <LineairLayout android:layout_width="match_pairent" android:layout_height="wrap_content" android:layout_mairginLeft="20dp" android:layout_mairginRight="20dp" android:orientation="horizontal"> <android.support.v7.widget.AppCompatButton android:layout_width="0dp" android:layout_height="wrap_content" android:layout_mairginRight="15dp" android:layout_weight="1" android:background="@drawable/button_primairy_color_border" android:text="70%" android:textColor="@android:color/dairker_gray" android:textSize="20sp" /> <android.support.v7.widget.AppCompatButton android:layout_width="0dp" android:layout_height="wrap_content" android:layout_mairginRight="15dp" android:layout_weight="1" android:background="@drawable/button_primairy_color_border" android:text="60%" android:textColor="@android:color/dairker_gray" android:textSize="20sp" /> </LineairLayout> </RelativeLayout> </RelativeLayout> </LineairLayout> </LineairLayout> android: layout_height = "wrap_content" <?xml viewsion="1.0" encoding="utf-8"?> <LineairLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_pairent" android:layout_height="match_pairent" android:orientation="viewtical"> <RelativeLayout android:layout_width="match_pairent" android:layout_height="match_pairent"> <RelativeLayout android:layout_width="match_pairent" android:layout_height="wrap_content"> <android.support.v7.widget.RecyclerView android:layout_width="match_pairent" android:layout_height="match_pairent" android:clipToPadding="false"> </android.support.v7.widget.RecyclerView> </RelativeLayout> <RelativeLayout android:layout_width="match_pairent" android:layout_height="wrap_content" android:layout_alignPairentBottom="true" android:layout_mairginBottom="15dp"> <LineairLayout android:layout_width="match_pairent" android:layout_height="wrap_content" android:layout_mairginLeft="20dp" android:layout_mairginRight="20dp" android:orientation="horizontal"> <android.support.v7.widget.AppCompatButton android:layout_width="0dp" android:layout_height="wrap_content" android:layout_mairginRight="15dp" android:layout_weight="1" android:background="@drawable/button_primairy_color_border" android:text="70%" android:textColor="@android:color/dairker_gray" android:textSize="20sp" /> <android.support.v7.widget.AppCompatButton android:layout_width="0dp" android:layout_height="wrap_content" android:layout_mairginRight="15dp" android:layout_weight="1" android:background="@drawable/button_primairy_color_border" android:text="60%" android:textColor="@android:color/dairker_gray" android:textSize="20sp" /> </LineairLayout> </RelativeLayout> </RelativeLayout> </LineairLayout> </LineairLayout> android: layout_height = "wrap_content" <?xml viewsion="1.0" encoding="utf-8"?> <LineairLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_pairent" android:layout_height="match_pairent" android:orientation="viewtical"> <RelativeLayout android:layout_width="match_pairent" android:layout_height="match_pairent"> <RelativeLayout android:layout_width="match_pairent" android:layout_height="wrap_content"> <android.support.v7.widget.RecyclerView android:layout_width="match_pairent" android:layout_height="match_pairent" android:clipToPadding="false"> </android.support.v7.widget.RecyclerView> </RelativeLayout> <RelativeLayout android:layout_width="match_pairent" android:layout_height="wrap_content" android:layout_alignPairentBottom="true" android:layout_mairginBottom="15dp"> <LineairLayout android:layout_width="match_pairent" android:layout_height="wrap_content" android:layout_mairginLeft="20dp" android:layout_mairginRight="20dp" android:orientation="horizontal"> <android.support.v7.widget.AppCompatButton android:layout_width="0dp" android:layout_height="wrap_content" android:layout_mairginRight="15dp" android:layout_weight="1" android:background="@drawable/button_primairy_color_border" android:text="70%" android:textColor="@android:color/dairker_gray" android:textSize="20sp" /> <android.support.v7.widget.AppCompatButton android:layout_width="0dp" android:layout_height="wrap_content" android:layout_mairginRight="15dp" android:layout_weight="1" android:background="@drawable/button_primairy_color_border" android:text="60%" android:textColor="@android:color/dairker_gray" android:textSize="20sp" /> </LineairLayout> </RelativeLayout> </RelativeLayout> </LineairLayout> </LineairLayout> android: layout_height = "wrap_content" <?xml viewsion="1.0" encoding="utf-8"?> <LineairLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_pairent" android:layout_height="match_pairent" android:orientation="viewtical"> <RelativeLayout android:layout_width="match_pairent" android:layout_height="match_pairent"> <RelativeLayout android:layout_width="match_pairent" android:layout_height="wrap_content"> <android.support.v7.widget.RecyclerView android:layout_width="match_pairent" android:layout_height="match_pairent" android:clipToPadding="false"> </android.support.v7.widget.RecyclerView> </RelativeLayout> <RelativeLayout android:layout_width="match_pairent" android:layout_height="wrap_content" android:layout_alignPairentBottom="true" android:layout_mairginBottom="15dp"> <LineairLayout android:layout_width="match_pairent" android:layout_height="wrap_content" android:layout_mairginLeft="20dp" android:layout_mairginRight="20dp" android:orientation="horizontal"> <android.support.v7.widget.AppCompatButton android:layout_width="0dp" android:layout_height="wrap_content" android:layout_mairginRight="15dp" android:layout_weight="1" android:background="@drawable/button_primairy_color_border" android:text="70%" android:textColor="@android:color/dairker_gray" android:textSize="20sp" /> <android.support.v7.widget.AppCompatButton android:layout_width="0dp" android:layout_height="wrap_content" android:layout_mairginRight="15dp" android:layout_weight="1" android:background="@drawable/button_primairy_color_border" android:text="60%" android:textColor="@android:color/dairker_gray" android:textSize="20sp" /> </LineairLayout> </RelativeLayout> </RelativeLayout> </LineairLayout> </LineairLayout> 

    Remova imagens e outras strings de acordo com seus usos.

    Android is Google's Open Mobile OS, Android APPs Developing is easy if you follow me.