user6221300
user6221300

Reputation:

How to write on an image XAML control?

I am trying to make credit card input system for my Xamarin.Forms App. I would like to enter a credit card number on a credit card image but I cannot figure out how to do so.

I would like to use XAML to write on the card like the gif below. any help would be appreciated!

I would like to do something like this

Upvotes: 3

Views: 247

Answers (1)

VahidShir
VahidShir

Reputation: 2106

You can overlap a label on your credit card image:

<AbsoluteLayout>
  <Image Source="cardImage.png"
         AbsoluteLayout.LayoutFlags="PositionProportional"
         AbsoluteLayout.LayoutBounds="0.5, 0.5, 150, 150"/>
  <Label Text="Credit card number here"
         AbsoluteLayout.LayoutFlags="All"
         AbsoluteLayout.LayoutBounds="0.5, 0.8, 1, 1"/>
</AbsoluteLayout>

Upvotes: 4

Related Questions