Ramakrishna
Ramakrishna

Reputation: 51

Horizontal pager in Jetpack Compose

Can we disable the scrolling behaviour for Horizontal Pager in jetpack compose because I am using buttons to scroll the pager

I found that we can do that older versions not in new versions

Upvotes: 0

Views: 2150

Answers (2)

user12741503
user12741503

Reputation:

as @Halifax's answer suffices, I'm assuming that you are using accompanist Pager API and it is now deprecated because Pager is now available in compose foundation dependency.

to prevent user swipe gesture it has the same parameter userScrollEnabled = false.

Thank you.

Upvotes: 1

Halifax
Halifax

Reputation: 765

Example:

HorizontalPager(
    ....
    userScrollEnabled = false
){ ... }

Upvotes: 1

Related Questions