Skip to content

UIScrollView: isScrollEnabled property ​

The isScrollEnabled property indicates whether the user can drag the scroll view.

Value ​

A boolean.

ValueEffect
trueThe user can drag
falseThe user cannot drag. Writing contentOffset from code still works
  • Readable and writable.
  • Defaults to true.
  • On a UITextView, after writing false, it no longer scrolls and instead becomes as tall as its lines of text.
  • Values of other types are converted by JS truthiness.
  • No change event: only the app's own code changes it.

Examples ​

js
const scroller = new UIScrollView();
scroller.isScrollEnabled = false;

Effect: the user cannot drag. Setting it back to true restores dragging.

Corresponding iOS API ​

UIScrollView.scrollEnabled (the getter is isScrollEnabled).

See also ​