美文网首页代码片段分享
Xamarin Forms Label 添加下划线

Xamarin Forms Label 添加下划线

作者: 花艺荣 | 来源:发表于2019-08-06 11:06 被阅读0次

    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

    相关文章

      网友评论

        本文标题:Xamarin Forms Label 添加下划线

        本文链接:https://www.haomeiwen.com/subject/dxhidctx.html