Skip to content

ScrollbarTheme

Customizes the colors, thickness, and shape of descendant scrollbars.

属性 ​

名称类型默认值说明
thumb_visibilityOptional[ControlStateValue[bool]]NoneIndicates that the scrollbar thumb should be visible, even when a scroll is not underway. When False, the scrollbar will be shown during scrolling and will fade out otherwise. When True, the scrollbar will always be visible and never fade out. Property value could be either a single boolean value or a dictionary with ft.ControlState as keys and boolean as values.
thicknessOptional[ControlStateValue[Optional[Number]]]NoneThe thickness of the scrollbar in the cross axis of the scrollable. Property value could be either a single float value or a dictionary with ft.ControlState as keys and float as values.
track_visibilityOptional[ControlStateValue[bool]]NoneIndicates that the scrollbar track should be visible. When True, the scrollbar track will always be visible so long as the thumb is visible. If the scrollbar thumb is not visible, the track will not be visible either. Defaults to False when None. If this property is None, then ScrollbarTheme.track_visibility of Theme.scrollbar_theme is used. If that is also None, the default value is False. Property value could be either a single boolean value or a dictionary with ft.ControlState as keys and boolean as values.
radiusOptional[Number]NoneThe Radius of the scrollbar thumb's rounded rectangle corners.
thumb_colorOptional[ControlStateValue[ColorValue]]NoneOverrides the default Color of the Scrollbar thumb. The value is either a single color string or ft.ControlState dictionary.
track_colorOptional[ControlStateValue[ColorValue]]NoneOverrides the default Color of the Scrollbar track. The value is either a single color string or ft.ControlState dictionary.
track_border_colorOptional[ControlStateValue[ColorValue]]NoneOverrides the default Color of the Scrollbar track border. The value is either a single color string or ft.ControlState dictionary.
cross_axis_marginOptional[Number]NoneDistance from the scrollbar thumb to the nearest cross axis edge in logical pixels. The scrollbar track consumes this space. Must not be null and defaults to 0.
main_axis_marginOptional[Number]NoneDistance from the scrollbar thumb's start and end to the edge of the viewport in logical pixels. It affects the amount of available paint area. The scrollbar track consumes this space. Mustn't be null and defaults to 0.
min_thumb_lengthOptional[Number]NoneThe preferred smallest size the scrollbar thumb can shrink to when the total scrollable extent is large, the current visible viewport is small, and the viewport is not overscrolled.
interactiveOptional[bool]NoneWhether the Scrollbar should be interactive and respond to dragging on the thumb, or tapping in the track area. When False, the scrollbar will not respond to gesture or hover events, and will allow to click through it. Defaults to True when None, unless on Android, which will default to False when None.

关注我,学习大模型、大数据、Python等热门技术。