# lv_obj_scroll.h (/api/core/lv_obj_scroll_h)



<RelatedHeaders name="lv_obj_scroll_private.h" isPrivate="false" />

<ApiSummary functions="28" enums="2" />

Functions [#functions]

<ApiTabs items="[&#x22;Setters (4)&#x22;,&#x22;Getters (12)&#x22;,&#x22;Other (12)&#x22;]">
  <ApiTab value="Setters (4)">
    <ApiMember kind="function" name="lv_obj_set_scrollbar_mode" file="core/lv_obj_scroll.h" line="59" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/core/lv_obj_scroll.h#L59">
      lv_obj_set_scrollbar_mode [#lv_obj_set_scrollbar_mode]

      Set how the scrollbars should behave.

      ```c title=" " lineNumbers=1
      void lv_obj_set_scrollbar_mode(lv_obj_t *obj, lv_scrollbar_mode_t mode)
      ```

      <span className="sr-only">
        Parameters
      </span>

      | Name   | Type                                             | Description                          |
      | ------ | ------------------------------------------------ | ------------------------------------ |
      | `obj`  | <ApiLink name="lv_obj_t" display="lv_obj_t *" /> | pointer to Widget                    |
      | `mode` | <ApiLink name="lv_scrollbar_mode_t" />           | LV\_SCROLL\_MODE\_ON/OFF/AUTO/ACTIVE |
    </ApiMember>

    <ApiMember kind="function" name="lv_obj_set_scroll_dir" file="core/lv_obj_scroll.h" line="66" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/core/lv_obj_scroll.h#L66">
      lv_obj_set_scroll_dir [#lv_obj_set_scroll_dir]

      Set direction Widget can be scrolled

      ```c title=" " lineNumbers=1
      void lv_obj_set_scroll_dir(lv_obj_t *obj, lv_dir_t dir)
      ```

      <span className="sr-only">
        Parameters
      </span>

      | Name  | Type                                             | Description                                                 |
      | ----- | ------------------------------------------------ | ----------------------------------------------------------- |
      | `obj` | <ApiLink name="lv_obj_t" display="lv_obj_t *" /> | pointer to Widget                                           |
      | `dir` | <ApiLink name="lv_dir_t" />                      | one or more bit-wise OR-ed values of `lv_dir_t` enumeration |
    </ApiMember>

    <ApiMember kind="function" name="lv_obj_set_scroll_snap_x" file="core/lv_obj_scroll.h" line="73" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/core/lv_obj_scroll.h#L73">
      lv_obj_set_scroll_snap_x [#lv_obj_set_scroll_snap_x]

      Set where to snap the children when scrolling ends horizontally

      ```c title=" " lineNumbers=1
      void lv_obj_set_scroll_snap_x(lv_obj_t *obj, lv_scroll_snap_t align)
      ```

      <span className="sr-only">
        Parameters
      </span>

      | Name    | Type                                             | Description                               |
      | ------- | ------------------------------------------------ | ----------------------------------------- |
      | `obj`   | <ApiLink name="lv_obj_t" display="lv_obj_t *" /> | pointer to Widget                         |
      | `align` | <ApiLink name="lv_scroll_snap_t" />              | value from `lv_scroll_snap_t` enumeration |
    </ApiMember>

    <ApiMember kind="function" name="lv_obj_set_scroll_snap_y" file="core/lv_obj_scroll.h" line="80" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/core/lv_obj_scroll.h#L80">
      lv_obj_set_scroll_snap_y [#lv_obj_set_scroll_snap_y]

      Set where to snap the children when scrolling ends vertically

      ```c title=" " lineNumbers=1
      void lv_obj_set_scroll_snap_y(lv_obj_t *obj, lv_scroll_snap_t align)
      ```

      <span className="sr-only">
        Parameters
      </span>

      | Name    | Type                                             | Description                               |
      | ------- | ------------------------------------------------ | ----------------------------------------- |
      | `obj`   | <ApiLink name="lv_obj_t" display="lv_obj_t *" /> | pointer to Widget                         |
      | `align` | <ApiLink name="lv_scroll_snap_t" />              | value from `lv_scroll_snap_t` enumeration |
    </ApiMember>
  </ApiTab>

  <ApiTab value="Getters (12)">
    <ApiMember kind="function" name="lv_obj_get_scrollbar_mode" file="core/lv_obj_scroll.h" line="91" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/core/lv_obj_scroll.h#L91">
      lv_obj_get_scrollbar_mode [#lv_obj_get_scrollbar_mode]

      Get the current scroll mode (when to hide the scrollbars)

      ```c title=" " lineNumbers=1
      lv_scrollbar_mode_t lv_obj_get_scrollbar_mode(const lv_obj_t *obj)
      ```

      <span className="sr-only">
        Parameters
      </span>

      | Name  | Type                                                   | Description       |
      | ----- | ------------------------------------------------------ | ----------------- |
      | `obj` | <ApiLink name="lv_obj_t" display="const lv_obj_t *" /> | pointer to Widget |

      **Returns:** <ApiLink name="lv_scrollbar_mode_t" /> — the current scroll mode from `lv_scrollbar_mode_t`
    </ApiMember>

    <ApiMember kind="function" name="lv_obj_get_scroll_dir" file="core/lv_obj_scroll.h" line="98" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/core/lv_obj_scroll.h#L98">
      lv_obj_get_scroll_dir [#lv_obj_get_scroll_dir]

      Get directions Widget can be scrolled (set with <ApiLink name="lv_obj_set_scroll_dir" display="lv_obj_set_scroll_dir()" />)

      ```c title=" " lineNumbers=1
      lv_dir_t lv_obj_get_scroll_dir(const lv_obj_t *obj)
      ```

      <span className="sr-only">
        Parameters
      </span>

      | Name  | Type                                                   | Description       |
      | ----- | ------------------------------------------------------ | ----------------- |
      | `obj` | <ApiLink name="lv_obj_t" display="const lv_obj_t *" /> | pointer to Widget |

      **Returns:** <ApiLink name="lv_dir_t" /> — current scroll direction bit(s)
    </ApiMember>

    <ApiMember kind="function" name="lv_obj_get_scroll_snap_x" file="core/lv_obj_scroll.h" line="105" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/core/lv_obj_scroll.h#L105">
      lv_obj_get_scroll_snap_x [#lv_obj_get_scroll_snap_x]

      Get where to snap child Widgets when horizontal scrolling ends.

      ```c title=" " lineNumbers=1
      lv_scroll_snap_t lv_obj_get_scroll_snap_x(const lv_obj_t *obj)
      ```

      <span className="sr-only">
        Parameters
      </span>

      | Name  | Type                                                   | Description       |
      | ----- | ------------------------------------------------------ | ----------------- |
      | `obj` | <ApiLink name="lv_obj_t" display="const lv_obj_t *" /> | pointer to Widget |

      **Returns:** <ApiLink name="lv_scroll_snap_t" /> — current snap value from `lv_scroll_snap_t`
    </ApiMember>

    <ApiMember kind="function" name="lv_obj_get_scroll_snap_y" file="core/lv_obj_scroll.h" line="112" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/core/lv_obj_scroll.h#L112">
      lv_obj_get_scroll_snap_y [#lv_obj_get_scroll_snap_y]

      Get where to snap child Widgets when vertical scrolling ends.

      ```c title=" " lineNumbers=1
      lv_scroll_snap_t lv_obj_get_scroll_snap_y(const lv_obj_t *obj)
      ```

      <span className="sr-only">
        Parameters
      </span>

      | Name  | Type                                                   | Description       |
      | ----- | ------------------------------------------------------ | ----------------- |
      | `obj` | <ApiLink name="lv_obj_t" display="const lv_obj_t *" /> | pointer to Widget |

      **Returns:** <ApiLink name="lv_scroll_snap_t" /> — current snap value from `lv_scroll_snap_t`
    </ApiMember>

    <ApiMember kind="function" name="lv_obj_get_scroll_x" file="core/lv_obj_scroll.h" line="122" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/core/lv_obj_scroll.h#L122">
      lv_obj_get_scroll_x [#lv_obj_get_scroll_x]

      Get current X scroll position. Identical to <ApiLink name="lv_obj_get_scroll_left" display="lv_obj_get_scroll_left()" />.

      ```c title=" " lineNumbers=1
      int32_t lv_obj_get_scroll_x(const lv_obj_t *obj)
      ```

      <span className="sr-only">
        Parameters
      </span>

      | Name  | Type                                                   | Description                            |
      | ----- | ------------------------------------------------------ | -------------------------------------- |
      | `obj` | <ApiLink name="lv_obj_t" display="const lv_obj_t *" /> | pointer to scrollable container Widget |

      **Returns:** <ApiLink name="int32_t" /> — current scroll position from left edge

      * If Widget is not scrolled return 0.
      * If scrolled return > 0.
      * If scrolled inside (elastic scroll) return \< 0.
    </ApiMember>

    <ApiMember kind="function" name="lv_obj_get_scroll_y" file="core/lv_obj_scroll.h" line="132" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/core/lv_obj_scroll.h#L132">
      lv_obj_get_scroll_y [#lv_obj_get_scroll_y]

      Get current Y scroll position. Identical to <ApiLink name="lv_obj_get_scroll_top" display="lv_obj_get_scroll_top()" />.

      ```c title=" " lineNumbers=1
      int32_t lv_obj_get_scroll_y(const lv_obj_t *obj)
      ```

      <span className="sr-only">
        Parameters
      </span>

      | Name  | Type                                                   | Description                            |
      | ----- | ------------------------------------------------------ | -------------------------------------- |
      | `obj` | <ApiLink name="lv_obj_t" display="const lv_obj_t *" /> | pointer to scrollable container Widget |

      **Returns:** <ApiLink name="int32_t" /> — current scroll position from top edge

      * If Widget is not scrolled return 0.
      * If scrolled return > 0.
      * If scrolled inside (elastic scroll) return \< 0.
    </ApiMember>

    <ApiMember kind="function" name="lv_obj_get_scroll_top" file="core/lv_obj_scroll.h" line="142" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/core/lv_obj_scroll.h#L142">
      lv_obj_get_scroll_top [#lv_obj_get_scroll_top]

      Number of pixels a scrollable container Widget can be scrolled down before its top edge appears. When LV\_OBJ\_FLAG\_SCROLL\_ELASTIC flag is set in Widget, this value can go negative while Widget is being dragged below its normal top-edge boundary.

      ```c title=" " lineNumbers=1
      int32_t lv_obj_get_scroll_top(const lv_obj_t *obj)
      ```

      <span className="sr-only">
        Parameters
      </span>

      | Name  | Type                                                   | Description                            |
      | ----- | ------------------------------------------------------ | -------------------------------------- |
      | `obj` | <ApiLink name="lv_obj_t" display="const lv_obj_t *" /> | pointer to scrollable container Widget |

      **Returns:** <ApiLink name="int32_t" /> — pixels Widget can be scrolled down before its top edge appears
    </ApiMember>

    <ApiMember kind="function" name="lv_obj_get_scroll_bottom" file="core/lv_obj_scroll.h" line="152" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/core/lv_obj_scroll.h#L152">
      lv_obj_get_scroll_bottom [#lv_obj_get_scroll_bottom]

      Number of pixels a scrollable container Widget can be scrolled up before its bottom edge appears. When LV\_OBJ\_FLAG\_SCROLL\_ELASTIC flag is set in Widget, this value can go negative while Widget is being dragged above its normal bottom-edge boundary.

      ```c title=" " lineNumbers=1
      int32_t lv_obj_get_scroll_bottom(const lv_obj_t *obj)
      ```

      <span className="sr-only">
        Parameters
      </span>

      | Name  | Type                                                   | Description                            |
      | ----- | ------------------------------------------------------ | -------------------------------------- |
      | `obj` | <ApiLink name="lv_obj_t" display="const lv_obj_t *" /> | pointer to scrollable container Widget |

      **Returns:** <ApiLink name="int32_t" /> — pixels Widget can be scrolled up before its bottom edge appears
    </ApiMember>

    <ApiMember kind="function" name="lv_obj_get_scroll_left" file="core/lv_obj_scroll.h" line="162" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/core/lv_obj_scroll.h#L162">
      lv_obj_get_scroll_left [#lv_obj_get_scroll_left]

      Number of pixels a scrollable container Widget can be scrolled right before its left edge appears. When LV\_OBJ\_FLAG\_SCROLL\_ELASTIC flag is set in Widget, this value can go negative while Widget is being dragged farther right than its normal left-edge boundary.

      ```c title=" " lineNumbers=1
      int32_t lv_obj_get_scroll_left(const lv_obj_t *obj)
      ```

      <span className="sr-only">
        Parameters
      </span>

      | Name  | Type                                                   | Description                            |
      | ----- | ------------------------------------------------------ | -------------------------------------- |
      | `obj` | <ApiLink name="lv_obj_t" display="const lv_obj_t *" /> | pointer to scrollable container Widget |

      **Returns:** <ApiLink name="int32_t" /> — pixels Widget can be scrolled right before its left edge appears
    </ApiMember>

    <ApiMember kind="function" name="lv_obj_get_scroll_right" file="core/lv_obj_scroll.h" line="172" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/core/lv_obj_scroll.h#L172">
      lv_obj_get_scroll_right [#lv_obj_get_scroll_right]

      Number of pixels a scrollable container Widget can be scrolled left before its right edge appears. When LV\_OBJ\_FLAG\_SCROLL\_ELASTIC flag is set in Widget, this value can go negative while Widget is being dragged farther left than its normal right-edge boundary.

      ```c title=" " lineNumbers=1
      int32_t lv_obj_get_scroll_right(const lv_obj_t *obj)
      ```

      <span className="sr-only">
        Parameters
      </span>

      | Name  | Type                                                   | Description                            |
      | ----- | ------------------------------------------------------ | -------------------------------------- |
      | `obj` | <ApiLink name="lv_obj_t" display="const lv_obj_t *" /> | pointer to scrollable container Widget |

      **Returns:** <ApiLink name="int32_t" /> — pixels Widget can be scrolled left before its right edge appears
    </ApiMember>

    <ApiMember kind="function" name="lv_obj_get_scroll_end" file="core/lv_obj_scroll.h" line="180" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/core/lv_obj_scroll.h#L180">
      lv_obj_get_scroll_end [#lv_obj_get_scroll_end]

      Get the X and Y coordinates where the scrolling will end for Widget if a scrolling animation is in progress. If no scrolling animation, give the current `x` or `y` scroll position.

      ```c title=" " lineNumbers=1
      void lv_obj_get_scroll_end(lv_obj_t *obj, lv_point_t *end)
      ```

      <span className="sr-only">
        Parameters
      </span>

      | Name  | Type                                                 | Description                                                              |
      | ----- | ---------------------------------------------------- | ------------------------------------------------------------------------ |
      | `obj` | <ApiLink name="lv_obj_t" display="lv_obj_t *" />     | pointer to scrollable Widget                                             |
      | `end` | <ApiLink name="lv_point_t" display="lv_point_t *" /> | pointer to <ApiLink name="lv_point_t" /> object in which to store result |
    </ApiMember>

    <ApiMember kind="function" name="lv_obj_get_scrollbar_area" file="core/lv_obj_scroll.h" line="278" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/core/lv_obj_scroll.h#L278">
      lv_obj_get_scrollbar_area [#lv_obj_get_scrollbar_area]

      Get the area of the scrollbars

      ```c title=" " lineNumbers=1
      void lv_obj_get_scrollbar_area(lv_obj_t *obj, lv_area_t *hor, lv_area_t *ver)
      ```

      <span className="sr-only">
        Parameters
      </span>

      | Name  | Type                                               | Description                                           |
      | ----- | -------------------------------------------------- | ----------------------------------------------------- |
      | `obj` | <ApiLink name="lv_obj_t" display="lv_obj_t *" />   | pointer to Widget                                     |
      | `hor` | <ApiLink name="lv_area_t" display="lv_area_t *" /> | pointer to store the area of the horizontal scrollbar |
      | `ver` | <ApiLink name="lv_area_t" display="lv_area_t *" /> | pointer to store the area of the vertical scrollbar   |
    </ApiMember>
  </ApiTab>

  <ApiTab value="Other (12)">
    <ApiMember kind="function" name="lv_obj_scroll_by" file="core/lv_obj_scroll.h" line="195" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/core/lv_obj_scroll.h#L195">
      lv_obj_scroll_by [#lv_obj_scroll_by]

      Scroll by given amount of pixels.

      ```c title=" " lineNumbers=1
      void lv_obj_scroll_by(lv_obj_t *obj, int32_t dx, int32_t dy, lv_anim_enable_t anim_en)
      ```

      <span className="sr-only">
        Parameters
      </span>

      | Name      | Type                                             | Description                                                            |
      | --------- | ------------------------------------------------ | ---------------------------------------------------------------------- |
      | `obj`     | <ApiLink name="lv_obj_t" display="lv_obj_t *" /> | pointer to scrollable Widget to scroll                                 |
      | `dx`      | <ApiLink name="int32_t" />                       | pixels to scroll horizontally                                          |
      | `dy`      | <ApiLink name="int32_t" />                       | pixels to scroll vertically                                            |
      | `anim_en` | <ApiLink name="lv_anim_enable_t" />              | LV\_ANIM\_ON: scroll with animation; LV\_ANIM\_OFF: scroll immediately |

      <Callout type="info">
        \> 0 value means scroll right/bottom (show the more content on the right/bottom)
      </Callout>

      <Callout type="info">
        e.g. dy = -20 means scroll down 20 px
      </Callout>
    </ApiMember>

    <ApiMember kind="function" name="lv_obj_scroll_by_bounded" file="core/lv_obj_scroll.h" line="206" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/core/lv_obj_scroll.h#L206">
      lv_obj_scroll_by_bounded [#lv_obj_scroll_by_bounded]

      Scroll by given amount of pixels. `dx` and `dy` will be limited internally to allow scrolling only on the content area.

      ```c title=" " lineNumbers=1
      void lv_obj_scroll_by_bounded(lv_obj_t *obj, int32_t dx, int32_t dy, lv_anim_enable_t anim_en)
      ```

      <span className="sr-only">
        Parameters
      </span>

      | Name      | Type                                             | Description                                                            |
      | --------- | ------------------------------------------------ | ---------------------------------------------------------------------- |
      | `obj`     | <ApiLink name="lv_obj_t" display="lv_obj_t *" /> | pointer to scrollable Widget to scroll                                 |
      | `dx`      | <ApiLink name="int32_t" />                       | pixels to scroll horizontally                                          |
      | `dy`      | <ApiLink name="int32_t" />                       | pixels to scroll vertically                                            |
      | `anim_en` | <ApiLink name="lv_anim_enable_t" />              | LV\_ANIM\_ON: scroll with animation; LV\_ANIM\_OFF: scroll immediately |

      <Callout type="info">
        e.g. dy = -20 means scroll down 20 px
      </Callout>
    </ApiMember>

    <ApiMember kind="function" name="lv_obj_scroll_to" file="core/lv_obj_scroll.h" line="216" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/core/lv_obj_scroll.h#L216">
      lv_obj_scroll_to [#lv_obj_scroll_to]

      Scroll to given coordinate on Widget. `x` and `y` will be limited internally to allow scrolling only on the content area.

      ```c title=" " lineNumbers=1
      void lv_obj_scroll_to(lv_obj_t *obj, int32_t x, int32_t y, lv_anim_enable_t anim_en)
      ```

      <span className="sr-only">
        Parameters
      </span>

      | Name      | Type                                             | Description                                                            |
      | --------- | ------------------------------------------------ | ---------------------------------------------------------------------- |
      | `obj`     | <ApiLink name="lv_obj_t" display="lv_obj_t *" /> | pointer to scrollable Widget to scroll                                 |
      | `x`       | <ApiLink name="int32_t" />                       | pixels to scroll horizontally                                          |
      | `y`       | <ApiLink name="int32_t" />                       | pixels to scroll vertically                                            |
      | `anim_en` | <ApiLink name="lv_anim_enable_t" />              | LV\_ANIM\_ON: scroll with animation; LV\_ANIM\_OFF: scroll immediately |
    </ApiMember>

    <ApiMember kind="function" name="lv_obj_scroll_to_x" file="core/lv_obj_scroll.h" line="225" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/core/lv_obj_scroll.h#L225">
      lv_obj_scroll_to_x [#lv_obj_scroll_to_x]

      Scroll to X coordinate on Widget. `x` will be limited internally to allow scrolling only on the content area.

      ```c title=" " lineNumbers=1
      void lv_obj_scroll_to_x(lv_obj_t *obj, int32_t x, lv_anim_enable_t anim_en)
      ```

      <span className="sr-only">
        Parameters
      </span>

      | Name      | Type                                             | Description                                                            |
      | --------- | ------------------------------------------------ | ---------------------------------------------------------------------- |
      | `obj`     | <ApiLink name="lv_obj_t" display="lv_obj_t *" /> | pointer to scrollable Widget to scroll                                 |
      | `x`       | <ApiLink name="int32_t" />                       | pixels to scroll horizontally                                          |
      | `anim_en` | <ApiLink name="lv_anim_enable_t" />              | LV\_ANIM\_ON: scroll with animation; LV\_ANIM\_OFF: scroll immediately |
    </ApiMember>

    <ApiMember kind="function" name="lv_obj_scroll_to_y" file="core/lv_obj_scroll.h" line="234" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/core/lv_obj_scroll.h#L234">
      lv_obj_scroll_to_y [#lv_obj_scroll_to_y]

      Scroll to Y coordinate on Widget. `y` will be limited internally to allow scrolling only on the content area.

      ```c title=" " lineNumbers=1
      void lv_obj_scroll_to_y(lv_obj_t *obj, int32_t y, lv_anim_enable_t anim_en)
      ```

      <span className="sr-only">
        Parameters
      </span>

      | Name      | Type                                             | Description                                                            |
      | --------- | ------------------------------------------------ | ---------------------------------------------------------------------- |
      | `obj`     | <ApiLink name="lv_obj_t" display="lv_obj_t *" /> | pointer to scrollable Widget to scroll                                 |
      | `y`       | <ApiLink name="int32_t" />                       | pixels to scroll vertically                                            |
      | `anim_en` | <ApiLink name="lv_anim_enable_t" />              | LV\_ANIM\_ON: scroll with animation; LV\_ANIM\_OFF: scroll immediately |
    </ApiMember>

    <ApiMember kind="function" name="lv_obj_scroll_to_view" file="core/lv_obj_scroll.h" line="241" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/core/lv_obj_scroll.h#L241">
      lv_obj_scroll_to_view [#lv_obj_scroll_to_view]

      Scroll `obj`'s parent Widget until `obj` becomes visible.

      ```c title=" " lineNumbers=1
      void lv_obj_scroll_to_view(lv_obj_t *obj, lv_anim_enable_t anim_en)
      ```

      <span className="sr-only">
        Parameters
      </span>

      | Name      | Type                                             | Description                                                            |
      | --------- | ------------------------------------------------ | ---------------------------------------------------------------------- |
      | `obj`     | <ApiLink name="lv_obj_t" display="lv_obj_t *" /> | pointer to Widget to scroll into view                                  |
      | `anim_en` | <ApiLink name="lv_anim_enable_t" />              | LV\_ANIM\_ON: scroll with animation; LV\_ANIM\_OFF: scroll immediately |
    </ApiMember>

    <ApiMember kind="function" name="lv_obj_scroll_to_view_recursive" file="core/lv_obj_scroll.h" line="249" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/core/lv_obj_scroll.h#L249">
      lv_obj_scroll_to_view_recursive [#lv_obj_scroll_to_view_recursive]

      Scroll `obj`'s parent Widgets recursively until `obj` becomes visible. Widget will be scrolled into view even it has nested scrollable parents.

      ```c title=" " lineNumbers=1
      void lv_obj_scroll_to_view_recursive(lv_obj_t *obj, lv_anim_enable_t anim_en)
      ```

      <span className="sr-only">
        Parameters
      </span>

      | Name      | Type                                             | Description                                                            |
      | --------- | ------------------------------------------------ | ---------------------------------------------------------------------- |
      | `obj`     | <ApiLink name="lv_obj_t" display="lv_obj_t *" /> | pointer to Widget to scroll into view                                  |
      | `anim_en` | <ApiLink name="lv_anim_enable_t" />              | LV\_ANIM\_ON: scroll with animation; LV\_ANIM\_OFF: scroll immediately |
    </ApiMember>

    <ApiMember kind="function" name="lv_obj_is_scrolling" file="core/lv_obj_scroll.h" line="256" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/core/lv_obj_scroll.h#L256">
      lv_obj_is_scrolling [#lv_obj_is_scrolling]

      Tell whether Widget is being scrolled or not at this moment

      ```c title=" " lineNumbers=1
      bool lv_obj_is_scrolling(const lv_obj_t *obj)
      ```

      <span className="sr-only">
        Parameters
      </span>

      | Name  | Type                                                   | Description       |
      | ----- | ------------------------------------------------------ | ----------------- |
      | `obj` | <ApiLink name="lv_obj_t" display="const lv_obj_t *" /> | pointer to Widget |

      **Returns:** <ApiLink name="bool" /> — true: `obj` is being scrolled
    </ApiMember>

    <ApiMember kind="function" name="lv_obj_stop_scroll_anim" file="core/lv_obj_scroll.h" line="263" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/core/lv_obj_scroll.h#L263">
      lv_obj_stop_scroll_anim [#lv_obj_stop_scroll_anim]

      Stop scrolling the current object

      ```c title=" " lineNumbers=1
      void lv_obj_stop_scroll_anim(const lv_obj_t *obj)
      ```

      <span className="sr-only">
        Parameters
      </span>

      | Name  | Type                                                   | Description               |
      | ----- | ------------------------------------------------------ | ------------------------- |
      | `obj` | <ApiLink name="lv_obj_t" display="const lv_obj_t *" /> | The object being scrolled |
    </ApiMember>

    <ApiMember kind="function" name="lv_obj_update_snap" file="core/lv_obj_scroll.h" line="270" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/core/lv_obj_scroll.h#L270">
      lv_obj_update_snap [#lv_obj_update_snap]

      Check children of `obj` and scroll `obj` to fulfill scroll\_snap settings.

      ```c title=" " lineNumbers=1
      void lv_obj_update_snap(lv_obj_t *obj, lv_anim_enable_t anim_en)
      ```

      <span className="sr-only">
        Parameters
      </span>

      | Name      | Type                                             | Description                                          |
      | --------- | ------------------------------------------------ | ---------------------------------------------------- |
      | `obj`     | <ApiLink name="lv_obj_t" display="lv_obj_t *" /> | Widget whose children need to be checked and snapped |
      | `anim_en` | <ApiLink name="lv_anim_enable_t" />              | LV\_ANIM\_ON/OFF                                     |
    </ApiMember>

    <ApiMember kind="function" name="lv_obj_scrollbar_invalidate" file="core/lv_obj_scroll.h" line="284" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/core/lv_obj_scroll.h#L284">
      lv_obj_scrollbar_invalidate [#lv_obj_scrollbar_invalidate]

      Invalidate the area of the scrollbars

      ```c title=" " lineNumbers=1
      void lv_obj_scrollbar_invalidate(lv_obj_t *obj)
      ```

      <span className="sr-only">
        Parameters
      </span>

      | Name  | Type                                             | Description       |
      | ----- | ------------------------------------------------ | ----------------- |
      | `obj` | <ApiLink name="lv_obj_t" display="lv_obj_t *" /> | pointer to Widget |
    </ApiMember>

    <ApiMember kind="function" name="lv_obj_readjust_scroll" file="core/lv_obj_scroll.h" line="291" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/core/lv_obj_scroll.h#L291">
      lv_obj_readjust_scroll [#lv_obj_readjust_scroll]

      Checks if the content is scrolled "in" and adjusts it to a normal position.

      ```c title=" " lineNumbers=1
      void lv_obj_readjust_scroll(lv_obj_t *obj, lv_anim_enable_t anim_en)
      ```

      <span className="sr-only">
        Parameters
      </span>

      | Name      | Type                                             | Description       |
      | --------- | ------------------------------------------------ | ----------------- |
      | `obj`     | <ApiLink name="lv_obj_t" display="lv_obj_t *" /> | pointer to Widget |
      | `anim_en` | <ApiLink name="lv_anim_enable_t" />              | LV\_ANIM\_ON/OFF  |
    </ApiMember>
  </ApiTab>
</ApiTabs>

Enums [#enums]

<ApiMember kind="enum" name="lv_scrollbar_mode_t" file="core/lv_obj_scroll.h" line="31" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/core/lv_obj_scroll.h#L31">
  lv_scrollbar_mode_t [#lv_scrollbar_mode_t]

  Scrollbar modes: shows when should the scrollbars be visible

  | Name                       | Description                                                      |
  | -------------------------- | ---------------------------------------------------------------- |
  | `LV_SCROLLBAR_MODE_OFF`    | Never show scrollbars                                            |
  | `LV_SCROLLBAR_MODE_ON`     | Always show scrollbars                                           |
  | `LV_SCROLLBAR_MODE_ACTIVE` | Show scroll bars when Widget is being scrolled                   |
  | `LV_SCROLLBAR_MODE_AUTO`   | Show scroll bars when the content is large enough to be scrolled |
</ApiMember>

<TypeUsedBy name="lv_scrollbar_mode_t" count="1">
  * `lv_obj_set_scrollbar_mode` — param `mode`
</TypeUsedBy>

<ApiMember kind="enum" name="lv_scroll_snap_t" file="core/lv_obj_scroll.h" line="39" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/core/lv_obj_scroll.h#L39">
  lv_scroll_snap_t [#lv_scroll_snap_t]

  Scroll span align options. Tells where to align the snappable children when scroll stops.

  | Name                    | Description                     |
  | ----------------------- | ------------------------------- |
  | `LV_SCROLL_SNAP_NONE`   | Do not align, leave where it is |
  | `LV_SCROLL_SNAP_START`  | Align to the left/top           |
  | `LV_SCROLL_SNAP_END`    | Align to the right/bottom       |
  | `LV_SCROLL_SNAP_CENTER` | Align to the center             |
</ApiMember>

<TypeUsedBy name="lv_scroll_snap_t" count="2">
  * `lv_obj_set_scroll_snap_x` — param `align`
  * `lv_obj_set_scroll_snap_y` — param `align`
</TypeUsedBy>

Dependencies [#dependencies]

<FileIncludes includes="[&#x22;lv_area.h&#x22;, &#x22;lv_anim.h&#x22;, &#x22;lv_types.h&#x22;]" includedBy="[&#x22;lv_obj.h&#x22;, &#x22;lv_obj_scroll_private.h&#x22;]" transitiveIncludes="[&#x22;lv_conf_internal.h&#x22;, &#x22;lv_conf_kconfig.h&#x22;, &#x22;lv_ext_data.h&#x22;, &#x22;lv_ll.h&#x22;, &#x22;lv_math.h&#x22;, &#x22;lv_tick.h&#x22;, &#x22;lv_timer.h&#x22;]" />
