Skip to main content

AnimateScroll

Trait AnimateScroll 

Source
pub trait AnimateScroll {
    // Required methods
    fn animate_scroll_by(&self, distance: f32);
    fn animate_scroll_to_item(&self, index: usize, offset: f32);
}
Expand description

Scrolls a lazy list with a spring. A press on the list, or another animation, stops it where it is.

Required Methods§

Source

fn animate_scroll_by(&self, distance: f32)

Scrolls distance logical pixels, positive toward the end.

Source

fn animate_scroll_to_item(&self, index: usize, offset: f32)

Scrolls until item index starts offset past the start of the viewport, as LazyListState::scroll_to_item would place it.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§