Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 91519

Xamarin.Forms Xaml to add icon image next to user name and password field

$
0
0

Does anyone know how to add an image next to a Text field used for data entry? I can't figure this out. I even tried to create an ImageCell.

Here is my code. This code centers the icon image just above the Text entry field.

<StackLayout Padding="20" Spacing="10" VerticalOptions="Center" Grid.Row="1" Grid.Column="0">
        <StackLayout Spacing="5">
          <Image Source="User_Profile_48.png" />
            <local:LineEntry Placeholder="email address" HorizontalOptions="FillAndExpand"
                             Text="{Binding UserName, Mode=TwoWay}"
                             Style="{StaticResource LineEntryStyle}" />  

          <Image Source="Briefcase_02_48.png" />
          <local:LineEntry Placeholder="password" IsPassword="True"
                           Text="{Binding UserPassword, Mode=TwoWay}"
                           Style="{StaticResource LineEntryStyle}" />
 </StackLayout>

Any help is much appreciated.

Thanks!


Viewing all articles
Browse latest Browse all 91519

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>