android - how to keep RecyclerView always scroll bottom -
i use recyclerview replace list view want keep recyclerview scroll bottom.
listview can use method settranscriptmode(abslistview.transcript_mode_always_scroll)
recyclerview use method smoothscrolltoposition(myadapter.getitemcount() - 1)
but when soft keyboard pop ,its replace recyclerview content.
this because rv thinks reference point top , when keyboard comes up, rv's size updated parent , rv keeps reference point stable. (thus keeps top position @ same location)
you can set layoutmanager#reverselayout true in case rv layout items end of adapter.
e.g. adapter position 0 @ bottom, 1 above etc...
this of course require reverse order of adapter.
i'm not sure setting stack end may give same result w/o reordering adapter.
Comments
Post a Comment