locked
How to add image infront of label RRS feed

  • Question

  • User370559 posted

    Hi all

    I'm unable to figure this out, how can I add an image/icon in front of a label? I can't post images yet so this is what i'm hoping to achieve:

    < MyIcon > alkjdlkfjasldkjfljlajsfds akfjdskljfklasjdlfjlksdjflkjjfa

    What's important is that the text should proceed under the icon. Does anyone know how to do this?

    Saturday, July 7, 2018 10:58 AM

Answers

  • User89714 posted

    @sebastiendecraene - That's one of those requirements where it might be easier to show the image and text in a WebView, as HTML/CSS provides the wrapping functionality you are after. So, put a WebView in your ContentPage, and use HTML/CSS as per https://www.coffeecup.com/help/articles/how-to-wrap-text-around-an-image/

    • Marked as answer by Anonymous Thursday, June 3, 2021 12:00 AM
    Saturday, July 7, 2018 11:28 PM

All replies

  • User367517 posted

    @sebastiendecraene

    I'm unable to figure this out, how can I add an image/icon in front of a label?

    Not sure at all what you mean. "In front of" could literally mean any direction in the app world. Do you want your label inside your image? Do you want your label to the left, right, top or bottom of your image? The first way is done simply with a grid, the second is by orienting a StackLayout with an image and label inside.

    I would look at other resources before using the forums, you are bound to find an answer way before needing to ask here. Here's a link to get you started:

    https://docs.microsoft.com/en-us/xamarin/xamarin-forms/get-started/introduction-to-xamarin-forms

    Saturday, July 7, 2018 11:01 PM
  • User89714 posted

    @sebastiendecraene - That's one of those requirements where it might be easier to show the image and text in a WebView, as HTML/CSS provides the wrapping functionality you are after. So, put a WebView in your ContentPage, and use HTML/CSS as per https://www.coffeecup.com/help/articles/how-to-wrap-text-around-an-image/

    • Marked as answer by Anonymous Thursday, June 3, 2021 12:00 AM
    Saturday, July 7, 2018 11:28 PM