1

I want to know how it's possible to prevent swipe in HorizontalPager, and how I can load next element by lazy. Now HorizontalPager creates first and second elements at once.

Stefano Sansone
  • 2,377
  • 7
  • 20
  • 39
Nariman
  • 41
  • 1
  • 4
  • 1
    Please don't ask two question at once. Using your question title it's impossible for others to find this question if they have the same problem. For the first one, see [this question](https://stackoverflow.com/questions/66502096/how-to-disable-and-enable-scrolling-in-lazycolumn-lazyrow-in-jetpack-compose). Both answer methods are not perfect, but one of them most probably will suit you. As to your second question, I don't think it's possible. Consider creating your own wrapper of `LazyRow` and settings width to full available size using `Modifier.fillParentMaxWidth()` – Phil Dukhov Oct 26 '21 at 12:21

1 Answers1

1

in HorizontalPager method, use userScrollEnabled = false to prevent swipe

Divya
  • 145
  • 10