取得或設定 Label 的格式化文字。 這是可繫結屬性。 C# publicMicrosoft.Maui.Controls.FormattedString FormattedText {get;set; } 屬性值 FormattedString FormattedString要顯示在標籤內的值。 這是可繫結屬性。 備註 將FormattedText 設定為非 Null 值會將 Text 屬性設定為 null。
TextType,类型为TextType,用于确定Label应显示纯文本还是 HTML 文本。 VerticalTextAlignment,类型为TextAlignment,用于定义所显示文本的垂直对齐方式。 这些属性由BindableProperty对象提供支持,表示它们可以是数据绑定的目标,并可以设置样式。 有关在Label上指定字体的信息,请参阅字体。
HorizontalTextAlignment类型TextAlignment,定义所显示文本的水平对齐方式。 LineBreakMode类型LineaBreakMode,确定文本在无法容纳一行时应如何处理。 LineHeight类型double,指定在显示文本时应用于默认行高度的乘数。 MaxLines类型int,指示允许的最大Label行数。 Padding类型Thickness,确定标签的填充。 Text类型string,定义显示为标...
<LabelMargin="10"LineHeight="2"InputTransparent="False"TextColor="Black"><Label.FormattedText><FormattedString><SpanText="Click "/><local:HyperlinkUIText="here"LinkUrl="https://docs.microsoft.com/xamarin/"/><SpanText=" to learn more about Syncfusion .NET MAUI Controls."/></FormattedString><...
Dog"Value="Dog"/><RadioButtonContent="Elephant"Value="Elephant"/><RadioButtonContent="Monkey"Value="Monkey"/><Labelx:Name="animalLabel"><Label.FormattedText><FormattedString><SpanText="你已选定:"/><SpanText="{Binding Selection}"/></FormattedString></Label.FormattedText></Label></StackLayout>...
<Label FontFamily="Consolas" Text="文心一言SECRET_KEY" TextColor="{StaticResource Cyan100Accent}" /> <Frame CornerRadius="10" Padding="3" Margin="0,10,0,0"> <VerticalStackLayout> <Entry x:Name="SECRET_KEY" Text="{Binding SECRET_KEY,Mode=TwoWay}" Margin="5,0,0,0" Placeholder="SECRET...
<Label LineBreakMode="NoWrap" LineHeight="1.4"> <Label.FormattedText> <FormattedString> <Span Text="Font name: Default "/> <Span Text="Version: 1.00 "/> <Span Text="Digitally Signed, TrueType Outlines "/> <Span Text="abcdefghijklmnopqrstuvwxyz "/> ...
Content="Elephant" Value="Elephant" /> <RadioButton Content="Monkey" Value="Monkey"/> <Label x:Name="animalLabel"> <Label.FormattedText> <FormattedString> <Span Text="You have chosen:" /> <Span Text="{Binding Selection}" /> </FormattedString> </Label.FormattedText> </Label> </...
<FormattedString> <Span Text="Already have an account? "/> <Span Text="Login" FontAttributes="Bold"/> </FormattedString> </Label.FormattedText> </Label> We have finished the first page, implementing steps one and two defined in the visual structure. Now, let’s continue creating the last...
新建.NET MAUI项目,命名RichTextEditor 在Controls目录中创建WysiwygContentEditor,继承自Editor,用于实现所见即所得的内容编辑器 构造函数中注册HandlerChanged和HandlerChanging事件 publicclassWysiwygContentEditor:Editor{publicWysiwygContentEditor(){ HandlerChanged+=WysiwygContentEditor_HandlerChanged; ...