pub struct ScrollBehavior {Show 20 fields
pub paging: bool,
pub snap_interval: Points,
pub snap_offsets: Vec<Points>,
pub snap_alignment: SnapAlignment,
pub deceleration: f32,
pub enabled: bool,
pub bounces: bool,
pub scrolls_to_top: bool,
pub smooth_wheel: bool,
pub wheel_line_height: Points,
pub content_inset: EdgeInsets,
pub scrollbar_inset: EdgeInsets,
pub keyboard_taps: KeyboardTaps,
pub one_step: bool,
pub min_zoom: f32,
pub max_zoom: f32,
pub bounces_zoom: bool,
pub pinch: bool,
pub center_content: bool,
pub refresh_indicator: Option<Points>,
}Expand description
How a scroll view scrolls (React Native’s ScrollView props).
Fields§
§paging: boolStops at multiples of the viewport.
snap_interval: PointsStops at multiples of this length (0: off).
snap_offsets: Vec<Points>Stops at these offsets.
snap_alignment: SnapAlignmentWhich point of a snap page aligns with the viewport.
deceleration: f32Velocity kept per millisecond after a fling (0: platform default).
enabled: boolThe user can scroll it.
bounces: boolIt overscrolls past its edges.
scrolls_to_top: boolA tap at the top of the window scrolls it to its top (iOS:
UIScrollView.scrollsToTop).
smooth_wheel: boolA mouse wheel’s notches glide (smoothWheel).
wheel_line_height: PointsPoints a mouse wheel’s line scrolls; 0 for the platform’s own
(wheelLineHeight).
content_inset: EdgeInsetsRoom around the content.
scrollbar_inset: EdgeInsetsHow far the scroll indicator keeps from each edge of the view: its track runs between the top and bottom insets (a horizontal view’s: left and right), and it moves in from the right (bottom) edge by the right (bottom) one. Platforms add the room they keep for the keyboard to the bottom.
keyboard_taps: KeyboardTapsWhether taps dismiss the keyboard.
one_step: boolA fling moves one snap point at most (disableIntervalMomentum).
min_zoom: f32minimumZoomScale.
max_zoom: f32maximumZoomScale: pinching zooms the content when above
min_zoom (<scroll> only, not lists).
bounces_zoom: boolbouncesZoom: pinching may go past the limits and springs back.
pinch: boolzoomable: the user can pinch to zoom.
center_content: boolcenterContent: content smaller than the viewport is centered.
refresh_indicator: Option<Points>refreshIndicator: the height of the app’s own pull-to-refresh
indicator, which replaces the platform’s spinner; None for the
platform’s.
Implementations§
Source§impl ScrollBehavior
impl ScrollBehavior
Sourcepub fn refreshes(&self, offset: Points) -> bool
pub fn refreshes(&self, offset: Points) -> bool
Whether a vertical scroll view dragged to offset (negative: pulled
past its top) refreshes when the finger lifts, if it listens to
onRefresh and is not refreshing yet.
Sourcepub fn refresh_threshold(&self) -> Points
pub fn refresh_threshold(&self) -> Points
How far past the top a released pull refreshes: the app’s indicator’s height, or the platform spinner’s distance.
Sourcepub fn refresh_inset(&self) -> Points
pub fn refresh_inset(&self) -> Points
The room kept above the content while it refreshes: the app’s indicator’s height, or the platform spinner’s.
Sourcepub fn snap_target(
&self,
offset: Points,
projected: Points,
velocity: f32,
viewport: Points,
content: Points,
) -> Option<Points>
pub fn snap_target( &self, offset: Points, projected: Points, velocity: f32, viewport: Points, content: Points, ) -> Option<Points>
The snap point a fling ends at, as in React Native: offset is
where the drag ended, projected where the fling would glide to
(both along the main axis, points) and velocity its speed (points
per millisecond), for a viewport of viewport and content of
content points. Pages (and one_step) move one snap point; other
snapping rounds the projected offset in the fling’s direction.
None without snapping.