-
Notifications
You must be signed in to change notification settings - Fork 3
Labels
Vetle444 edited this page Nov 10, 2023
·
1 revision
Label
displays single-line and multi-line text. Text displayed by a Label
can be colored, spaced, and can have text decorations.
We have defined three different categories of styles for Label
:
-
Header
- Bold font
-
UI
- Medium-bold font
-
Body
- Normal font
Each of these style categories has a different weight, such as: UI400
, to control the font-size.
The default style is set to
Body300
Inspect LabelStyle.cs to see all of the different styles.
Here we place a Label
with a style of Body
with a weight of 400
.
<dui:Label Style="{dui:Styles Label=Body400}" />
To make use of these styles you have to implement the font of your choice. This is done in MauiAppBuilder.cs
.
builder.ConfigureFonts(fonts =>
{
fonts.AddFont("OpenSans-Bold.ttf", "Header");
fonts.AddFont("OpenSans-Medium.ttf", "UI");
fonts.AddFont("OpenSans-Regular.ttf", "Body");
});
NB: It is important that the aliases are exactly
Header
,UI
andBody
.