java - RecyclerView creates margins when scrolling sometimes -


recyclerview creates margin comes out after scrolling , down. doesn't occur items occur same item.

edit: margins marked black circles bigger green ones. supposed have same space between each items

margins marked black circles bigger green ones. supposed have same space between each itesm

and here xml code

<relativelayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:paddingbottom="@dimen/activity_vertical_margin" android:paddingleft="@dimen/activity_horizontal_margin" android:paddingright="@dimen/activity_horizontal_margin" tools:context="com.mangolassi.norman.steller.messageroomactivity">  <android.support.v7.widget.recyclerview      android:id="@+id/messagerecyclerview"     android:layout_width="match_parent"     android:layout_height="wrap_content"     android:layout_above="@+id/linearlayout"/>  <linearlayout     android:id="@+id/linearlayout"     android:layout_width="match_parent"     android:layout_height="wrap_content"     android:layout_alignparentbottom="true"     android:layout_alignparentleft="true"     android:layout_alignparentstart="true"     android:orientation="horizontal">      <edittext         android:id="@+id/messageedittext"         android:layout_width="0dp"         android:layout_height="wrap_content"         android:layout_gravity="center_vertical"         android:layout_weight="1"/>      <button         android:id="@+id/sendbutton"         android:layout_width="wrap_content"         android:layout_height="wrap_content"         android:layout_gravity="bottom"         android:enabled="false"         android:text="send"/>  </linearlayout> 

and here item xml

<linearlayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="vertical">  <relativelayout     android:layout_width="wrap_content"     android:layout_height="wrap_content"     android:gravity="center_vertical"     android:orientation="horizontal">      <linearlayout         android:layout_width="wrap_content"         android:layout_height="wrap_content">          <de.hdodenhof.circleimageview.circleimageview             android:id="@+id/useravatar"             android:layout_width="46dp"             android:layout_height="46dp"             android:layout_marginleft="10dp"             android:src="@mipmap/default_avatar"             />          <textview             style="@style/incomingmessage"             android:id="@+id/messagetextview"             android:text="bsp"             android:layout_width="wrap_content"             android:layout_height="wrap_content"             />      </linearlayout>     <textview         style="@style/outgoingmessage"         android:id="@+id/messagetextview2"         android:text="bsp"         android:layout_width="wrap_content"         android:layout_height="wrap_content" />  </relativelayout> </linearlayout> 

im using latest android studio


Comments

Popular posts from this blog

cookies - Yii2 Advanced - Share session between frontend and mainsite (duplicate of frontend for www) -

angular - password and confirm password field validation angular2 reactive forms -

php - Permission denied. Laravel linux server -