2017-08-04 5 views
-2

にスペースを追加します浮動措置によってカバーされるべきではなく、アクセスする資格があるようにしてください。私はrecyclerviewの各項目は、それだけのためのスペースを作るためにどのように浮動ボタンでカバーなっているaccessedbecauseいくつかのUI elements.Atlastその項目のUIをすることはできません持っている活動のrecyclerviewと、フローティングアクションボタンを追加したRecyclerview

<?xml version="1.0" encoding="utf-8"?> 
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" 
xmlns:tools="http://schemas.android.com/tools" 
xmlns:app="http://schemas.android.com/apk/res-auto" 
android:id="@+id/activity_main" 
android:layout_width="match_parent" 
android:layout_height="match_parent" 
tools:context="com.packtpub.ups.customer.Second" 
android:background="#DCDCDC"> 
<android.support.v7.widget.RecyclerView 
    android:id="@+id/recyclerView1" 
    android:layout_width="match_parent" 
    android:layout_height="wrap_content"> 
</android.support.v7.widget.RecyclerView> 
<android.support.design.widget.FloatingActionButton 
    android:id="@+id/nextToThird" 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" 
    app:backgroundTint="@color/colorgreen" 
    android:src="@drawable/right" 
    android:layout_alignParentBottom="true" 
    android:layout_alignParentRight="true" 
    android:layout_margin="20dp" /> 
</RelativeLayout> 

ここに私のアイテムコンテナがあります。 XMLでRecyclerViewタグ内の行の下に

<LinearLayout 
    android:layout_height="50dp" 
    android:layout_width="match_parent" 
    android:layout_marginTop="20dp" 
    android:layout_marginBottom="20dp" 
    android:id="@+id/buttons"> 

<Button android:layout_height="40dp" 
    android:layout_width="80dp" 
    android:id="@+id/accept" 
    android:layout_marginTop="7dp" 
    style="@style/Widget.AppCompat.Button" 
    android:background="@drawable/scan_button" 
    android:layout_marginStart="30dp" 
    android:layout_marginLeft="30dp" 
    android:text="@string/Accept"/> 

<Button android:layout_height="40dp" 
    android:layout_width="80dp" 
    android:id="@+id/decline" 
    style="@style/Widget.AppCompat.Button" 
    android:background="@drawable/scan_button" 
    android:layout_marginStart="30dp" 
    android:layout_marginLeft="30dp" 
    android:text="@string/Decline"/> 

    <Button android:layout_height="40dp" 
     android:layout_width="80dp" 
     android:id="@+id/viewmode" 
     android:layout_marginTop="7dp" 
     style="@style/Widget.AppCompat.Button" 
     android:background="@drawable/scan_button" 
     android:layout_marginStart="30dp" 
     android:layout_marginLeft="30dp" 
     android:text="@string/Viewmode"/> 
    </LinearLayout> 

答えて

1

使用、アダプターで

android:paddingBottom="85dp" 
android:clipToPadding="false" 
0

変更

if (position == list.size()-1) 
{ 
    viewHolder.setPadding(150,0,0,0); 
} 
関連する問題