Xamarin.Forms 版本3.2以上可以这样实现:
<Label Grid.Row="1" Grid.ColumnSpan="4" Margin="0,10,0,0" FontSize="12">
<Label.FormattedText>
<FormattedString>
<Span Text="https://wwww.cameraftp.56/parentID123456/isEmBededtrue/waipatik"
TextColor="Blue" x:Name="publishURL"
TextDecorations="Underline">
<Span.GestureRecognizers>
<!--<TapGestureRecognizer Command="{Binding ClickCommand}" CommandParameter="https://xamarin.com" />-->
<TapGestureRecognizer NumberOfTapsRequired="1" Tapped="Button_OnClicked_toviewpublish"/>
</Span.GestureRecognizers>
</Span>
<!--<Span Text=" Some more text." />-->
</FormattedString>
</Label.FormattedText>
<Label.GestureRecognizers>
<TapGestureRecognizer NumberOfTapsRequired="1" Tapped="Button_OnClicked_toviewpublish"/>
</Label.GestureRecognizers>
</Label>
效果:
20190806110358.png
网友评论