简体   繁体   中英

Bug RecyclerView.scrollToPosition(list.size()-1) in Dialog

I have created RecyclerView with list of clients (from 0 till 14). I need maximum down state. For this purpose I am using method RecyclerView.scrollToPosition(14).

When RecyclerView are placing in Activity, I have the good result.

IMAGE: RecyclerView are placing in Activity

And now I am inflating new RecyclerView and put it in Dialog. The Adapter of RecyclerView the same. Method RecyclerView.scrollToPosition(14) give me the bad result (scroll is not set on the 14th position, by the way I can pull it to the down manually):

IMAGE: Bad result in Dialog

Why it happens? I think the problem in parent (Dialog) of RecyclerView. But I don't know what to do.

UPDATED! I think this is a really bug of RecyclerView. Because with ListView is all right (in my case with setSelection(14)).

Because your interaction panel hide the last element. Position your recycler view above the panel.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM