Search code examples
androidscrollandroid-jetpack-composelaglazycolumn

Reasons for the lag of smooth scrolling on lazy column in android jetpack compose


I just use the lazy column for showing the my custom items on the view. I tried with this with itemsIndexed with as well. But lagging issue is not solved.

What can be the reasons for this?


Solution

  • Since you did not share any code anyone cannot give a specific reason for this to you but generally there are bunch of optimization tricks you can apply like:

    • passing a unique key to your LazyColumn,
    • running it in release build instead of debug
    • if your "custom items" include an image, making sure the image library use use contains a cacheing mechanism
    • using @Stable, @Immutableannotations in your ui state data classes etc.