class UI::PageControl

Overview

A horizontal row of dot indicators showing position in a paged list.

Maps to UIPageControl on iOS/iPadOS. On macOS (where no native NSPageControl exists), the AppKit renderer synthesizes an NSStackView of small circle CALayer views — one filled, others outlined.

HIG: "A page control displays a row of indicator images, each of which represents a page in a flat list." — Page controls, abstract.

HIG: "Center a page control at the bottom of the view or window." The host is responsible for positioning; this view provides the control itself.

Defined in:

ui/views/page_control.cr

Constructors

Instance Method Summary

Instance methods inherited from class UI::View

accept(visitor : PlatformVisitor) accept, accessibility_label : String | Nil accessibility_label, accessibility_label=(accessibility_label : String | Nil) accessibility_label=, background : Color | Nil background, background=(background : Color | Nil) background=, blur_radius : Float64 blur_radius, blur_radius=(blur_radius : Float64) blur_radius=, border_color : Color | Nil border_color, border_color=(border_color : Color | Nil) border_color=, border_width : Float64 border_width, border_width=(border_width : Float64) border_width=, clip_to_bounds : Bool clip_to_bounds, clip_to_bounds=(clip_to_bounds : Bool) clip_to_bounds=, container_query(name : String) : self container_query, container_query_name : String | Nil container_query_name, container_query_name=(container_query_name : String | Nil) container_query_name=, corner_radius : Float64 corner_radius, corner_radius=(corner_radius : Float64) corner_radius=, fill_screen! : self fill_screen!, fluid_height(min : String | Number, ideal : String | Number, max : String | Number) : self
fluid_height : UI::Fluid | Nil
fluid_height
, fluid_height=(fluid_height : UI::Fluid | Nil) fluid_height=, fluid_width(min : String | Number, ideal : String | Number, max : String | Number) : self
fluid_width : UI::Fluid | Nil
fluid_width
, fluid_width=(fluid_width : UI::Fluid | Nil) fluid_width=, hidden : Bool hidden, hidden=(hidden : Bool) hidden=, id : String | Nil id, id=(id : String | Nil) id=, maximum_height : Float64 | Nil maximum_height, maximum_height=(maximum_height : Float64 | Nil) maximum_height=, maximum_width : Float64 | Nil maximum_width, maximum_width=(maximum_width : Float64 | Nil) maximum_width=, minimum_height : Float64 | Nil minimum_height, minimum_height=(minimum_height : Float64 | Nil) minimum_height=, minimum_width : Float64 | Nil minimum_width, minimum_width=(minimum_width : Float64 | Nil) minimum_width=, opacity : Float64 opacity, opacity=(opacity : Float64) opacity=, padding : EdgeInsets padding, padding=(padding : EdgeInsets) padding=, root_fill : Bool root_fill, root_fill=(root_fill : Bool) root_fill=, shadow_color : Color | Nil shadow_color, shadow_color=(shadow_color : Color | Nil) shadow_color=, shadow_offset_x : Float64 shadow_offset_x, shadow_offset_x=(shadow_offset_x : Float64) shadow_offset_x=, shadow_offset_y : Float64 shadow_offset_y, shadow_offset_y=(shadow_offset_y : Float64) shadow_offset_y=, shadow_radius : Float64 shadow_radius, shadow_radius=(shadow_radius : Float64) shadow_radius=, swiftkit_state_handle : Pointer(Void) | Nil swiftkit_state_handle, swiftkit_state_handle=(swiftkit_state_handle : Pointer(Void) | Nil) swiftkit_state_handle=, test_id : String | Nil test_id, test_id=(test_id : String | Nil) test_id=

Constructor Detail

def self.new(total : Int32, current : Int32 = 0) #

[View source]

Instance Method Detail

def accept(visitor : PlatformVisitor) #
Description copied from class UI::View

Accept a platform visitor for rendering dispatch. Each concrete view type calls visitor.visit(self).


[View source]
def background_style : Symbol #

Background style on iOS 14+. :automatic — shows background only during interaction (default). :prominent — always shows background; use when this is the primary nav. :minimal — never shows background; position-only display.


[View source]
def background_style=(background_style : Symbol) #

Background style on iOS 14+. :automatic — shows background only during interaction (default). :prominent — always shows background; use when this is the primary nav. :minimal — never shows background; position-only display.


[View source]
def current : Int32 #

Zero-based index of the currently selected page (filled dot).


[View source]
def current=(current : Int32) #

Zero-based index of the currently selected page (filled dot).


[View source]
def page_indicator_tint_color : Color | Nil #

Optional tint color for non-current page indicators. When nil defaults to a translucent version of the tint_color / system default.


[View source]
def page_indicator_tint_color=(page_indicator_tint_color : Color | Nil) #

Optional tint color for non-current page indicators. When nil defaults to a translucent version of the tint_color / system default.


[View source]
def tint_color : Color | Nil #

Optional tint color for the current-page indicator. When nil, UIPageControl defaults to UIColor.label (system-tracked). HIG: "Avoid coloring indicator images. Custom colors can reduce the contrast that differentiates the current-page indicator."


[View source]
def tint_color=(tint_color : Color | Nil) #

Optional tint color for the current-page indicator. When nil, UIPageControl defaults to UIColor.label (system-tracked). HIG: "Avoid coloring indicator images. Custom colors can reduce the contrast that differentiates the current-page indicator."


[View source]
def total : Int32 #

Total number of pages (dots) to display.


[View source]
def total=(total : Int32) #

Total number of pages (dots) to display.


[View source]