Divider
extension Divider
修改分割线颜色使用background方法即可,示例:background(Color.gray)
-
分割线默认尺寸配置,未自定义时1像素,仅影响Divider和Rectangle的dividerStyle方法
Declaration
Swift
public nonisolated static var defaultSize: CGFloat { get set }
-
分割线默认颜色,未自定义时为灰色,仅影响Divider和Rectangle的dividerStyle方法
Declaration
Swift
public nonisolated static var defaultColor: Color { get }
-
自定义分割线默认颜色配置句柄,默认nil
Declaration
Swift
public nonisolated static var defaultColorConfiguration: (@Sendable () -> Color)? { get set }
-
自定义分割线尺寸,使用scale实现,参数nil时为Divider默认配置
Declaration
Swift
public func dividerStyle(size: CGFloat? = nil, color: Color? = nil) -> some View