Hello,
Welcome to our Microsoft Q&A platform!
I put the RecycleView in the Linearlayout
, then I set the LayoutChange
event for Linearlayout
, I use set SpanCount
like following code, it could Updating GridLayoutManager's SpanCount dynamically.
PhotoAlbumAdapter mAdapter = new PhotoAlbumAdapter(photoAlbum);
mRecyclerView.SetAdapter(mAdapter);
GridLayoutManager mLayoutManager = new GridLayoutManager(this,2);
mRecyclerView.SetLayoutManager(mLayoutManager);
linearLayout1.LayoutChange += (o, e) =>
{
mLayoutManager.SpanCount = 3;
};
If you still cannot work, please share your part of code or demo that could reproduce this issue.
Best Regards,
Leon Lu
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.