Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to draw a line on label text in xamarin forms

As shown in the image below I need to draw a line dynamically on a label text. Here is my label in listview

enter image description here

Can anyone please tell me about this?

like image 678
keertana Avatar asked Mar 03 '17 10:03

keertana


1 Answers

Here you go, you can make your own control (strikedLabel) and place this code. To make it more fun and flexiable you can add bindable properties like (IsStriked, StrikeColor, etc...) , remember that order between the label and the BoxView is important

<Grid>
    <Label VerticalOptions="Center" Text="Sample string" />
    <BoxView HeightRequest="3"
    VerticalOptions="Center"
    Opacity="0.5"
    Color="Aqua" />
</Grid>
like image 108
Ahmad ElMadi Avatar answered Sep 30 '22 14:09

Ahmad ElMadi