Fabulous API
Documentation
2.0
2.0
  • Welcome
  • Xamarin.Forms
    • AnyView
    • Application
    • Element
    • NavigableElement
    • VisualElement
    • View
    • Controls
      • ActivityIndicator
      • BoxView
      • Button
      • CheckBox
      • DatePicker
      • Editor
      • Entry
      • FormattedLabel
      • ImageButton
      • Image
      • IndicatorView
      • InputView
      • Label
      • Picker
      • ProgressBar
      • RadioButton
      • SearchBar
      • Slider
      • Span
      • Stepper
      • Switch
      • TimePicker
      • WebView
    • Collections
      • CarouselView
      • CollectionView
      • ItemsView
      • ListView
    • Layouts
      • Layout
      • TemplatedView
  • .NET MAUI
    • AnyView
    • Application
    • Element
    • NavigableElement
    • VisualElement
    • View
    • Controls
      • ActivityIndicator
      • BoxView
      • Button
      • CheckBox
      • DatePicker
      • Editor
      • Entry
      • FormattedLabel
      • ImageButton
      • Image
      • IndicatorView
      • InputView
      • Label
      • Picker
      • ProgressBar
      • RadioButton
      • SearchBar
      • Slider
      • Span
      • Stepper
      • Switch
      • TimePicker
      • WebView
    • Collections
      • CarouselView
      • CollectionView
      • ItemsView
      • ListView
    • Layouts
      • Layout
      • TemplatedView
  • Avalonia
    • AnyView
    • Application
    • RenderOptions
    • Animatable
    • StyledElement
    • Transform
    • Visual
    • Layoutable
    • InputElement
    • DragDrop
    • FlyoutBase
    • PopupFlyoutBase
    • Control
    • Decorator
    • TemplatedControl
    • ContentControl
    • Spinner
    • TopLevel
    • TextElement
    • ItemsControl
    • SelectingItemsControl
    • MenuBase
    • WindowBase
    • Styling
      • KeyFrame
      • Animation
      • Transition
      • Style
    • Media
      • Transforms
        • Transform
        • MatrixTransform
        • SkewTransform
        • RotateTransform
        • TranslateTransform
        • ScaleTransform
        • Rotate3DTransform
        • TransformGroup
      • Brushes
        • Brush
        • TileBrush
        • SolidColorBrush
        • VisualBrush
        • ImageBrush
        • DrawingBrush
        • GradientStop
        • GradientBrush
        • ConicGradientBrush
        • LinearGradientBrush
        • RadialGradientBrush
      • PathSegments
        • PathSegment
        • ArcSegment
        • BezierSegment
        • PolyLineSegment
        • QuadraticBezierSegment
        • PathFigure
      • Geometries
        • Geometry
        • LineGeometry
        • EllipseGeometry
        • RectangleGeometry
        • PolylineGeometry
        • PathGeometry
        • CombinedGeometry
        • GeometryGroup
      • DashStyle
      • Pen
      • Drawing
      • Effects
Powered by GitBook
On this page
  • Constructors
  • Properties
  • Usages
Edit on GitHub
  1. .NET MAUI
  2. Controls

Span

PreviousSliderNextStepper

Last updated 1 year ago

Inheritance: }) Xamarin.Forms documentation: Span

For details on how the control actually works, please refer to the .

Constructors

Constructors
Description

Span(text: string)

Define a Span widget with a text

Properties

Properties
Description

backgroundColor(light: FabColor, ?dark: FabColor)

Sets the background color depending if light or dark mode

characterSpacing(value: float)

Sets the character spacing

font(?size: float, ?namedSize: NamedSize, ?attributes: FontAttributes, ?fontFamily: string)

Sets the font

lineHeight(value: float)

Sets the line height

style(value: Style)

Sets the style to apply

textColor(light: FabColor, ?dark: FabColor)

Sets the text color depending if light or dark mode

textDecorations(value: TextDecorations)

Sets the text decoration

textTransform(value: TextTransform)

Sets the text transformation

gestureRecognizers()

Sets a collection of gesture recognizers to attach to this widget

reference(value: ViewRef<Span>)

Sets a ViewRef instance to retrieve the Xamarin.Forms.Span instance associated to this widget

Usages

Span("Hello, Word!")
    .backgroundColor(Color.Red.ToFabColor(), dark = Color.Blue.ToFabColor())  
    .characterSpacing(2.)   
    .font(namedSize = NamedSize.Large, fontFamily = "Arial", attributes = FontAttributes.Bold)
    .lineHeight(1.5) 
    .style(Xamarin.Forms.Style())  
    .textColor(Color.Red.ToFabColor(), dark = Color.Blue.ToFabColor()) 
    .textDecorations(TextDecorations.Underlined) 
    .textTransform(TextTransform.Lowercase) 
    .gestureRecognizers() {
      TapGestureRecognizer(...)
      SwipeGestureRecognizer(...)
    }

Get access to the underlying Xamarin.Forms.Span

let spanRef = ViewRef<Span>()

Span("Hello, World!")
    .reference(spanRef) 
Element
API
Xamarin.Forms documentation