Hello @simone pittiglio
looks at this topic perhpas
https://social.msdn.microsoft.com/Forums/en-US/ca6fa5a1-548a-48b7-a086-66b594035e67/display-an-image-inside-in-a-text?forum=xamarinforms
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
I need to insert an image inside a label in Xamarin forms. Sample: "Click this image {img.png} to add item"
I tryied to convert my png to Font and use it as Span inside the label but I failed (I don't know how to use the ttf file in the span). Any other suggestion? I prefer to avoid html view
Thank's a lot
Hello @simone pittiglio ,
Welcome to our Microsoft Q&A platform!
I need to insert an image inside a label in Xamarin forms. Sample: "Click this image {img.png} to add item"
To display the content as above, try using a StackLayout
to wraps the views and set the Orientation to Horizontal. For the image's click event, you could add tap gesture to the image control.
Here is the sample code, you could refer to it.
<StackLayout Orientation="Horizontal">
<Label Text="Click this image"/>
<Image Source="yali" HeightRequest="25">
<Image.GestureRecognizers>
<TapGestureRecognizer Tapped="TapGestureRecognizer_Tapped"/>
</Image.GestureRecognizers>
</Image>
<Label Text="to add the item"/>
</StackLayout>
Best Regards,
Jarvan Zhang
If the response is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.