Joe*_*e B 5 c# xaml xamarin.forms
我如何在Xamarin Forms的Formatted Text Label中保留空白,我尝试过此操作,但似乎不起作用
<Label FontSize="Medium">
<Label.FormattedText>
<FormattedString>
<Span xml:space="preserve">On PO: </Span>
<Span xml:space="preserve"> </Span>
<Span FontAttributes="Bold" FontSize="Large" Text="{Binding Qty}"/>
</FormattedString>
</Label.FormattedText>
</Label>
Run Code Online (Sandbox Code Playgroud)
我得到这个错误
Error Position 22:35. No property, bindable property, or event found for 'space', or mismatching type between value and property.
小智 5
使用跨度的text属性给空格。
<Label FontSize="Medium">
<Label.FormattedText>
<FormattedString>
<Span Text="On PO: "/>
<Span Text=" "/>
<Span FontAttributes="Bold" FontSize="Large" Text="{Binding Qty}"/>
</FormattedString>
</Label.FormattedText>
</Label>
Run Code Online (Sandbox Code Playgroud)