Replicating an App Login Screen in Xamarin.Forms | Syncfusion Blogs
Live Chat Icon For mobile
Live Chat Icon
Popular Categories.NET  (179).NET Core  (28).NET MAUI  (214)Angular  (112)ASP.NET  (51)ASP.NET Core  (83)ASP.NET MVC  (90)Azure  (41)Black Friday Deal  (1)Blazor  (227)BoldSign  (15)DocIO  (24)Essential JS 2  (109)Essential Studio  (200)File Formats  (69)Flutter  (133)JavaScript  (226)Microsoft  (120)PDF  (82)Python  (1)React  (105)Streamlit  (1)Succinctly series  (131)Syncfusion  (946)TypeScript  (33)Uno Platform  (3)UWP  (3)Vue  (45)Webinar  (52)Windows Forms  (61)WinUI  (71)WPF  (163)Xamarin  (160)XlsIO  (38)Other CategoriesBarcode  (5)BI  (29)Bold BI  (8)Bold Reports  (2)Build conference  (9)Business intelligence  (55)Button  (4)C#  (158)Chart  (140)Chart of the week  (54)Cloud  (15)Company  (443)Dashboard  (8)Data Science  (3)Data Validation  (8)DataGrid  (70)Development  (661)Doc  (8)DockingManager  (1)eBook  (99)Enterprise  (22)Entity Framework  (7)Essential Tools  (14)Excel  (43)Extensions  (23)File Manager  (7)Gantt  (19)Gauge  (12)Git  (5)Grid  (31)HTML  (13)Installer  (2)Knockout  (2)Language  (1)LINQPad  (1)Linux  (2)M-Commerce  (1)Metro Studio  (11)Mobile  (512)Mobile MVC  (9)OLAP server  (1)Open source  (1)Orubase  (12)Partners  (21)PDF viewer  (43)Performance  (12)PHP  (2)PivotGrid  (5)Predictive Analytics  (6)Report Server  (3)Reporting  (10)Reporting / Back Office  (11)Rich Text Editor  (12)Road Map  (12)Scheduler  (54)Security  (4)SfDataGrid  (9)Silverlight  (21)Sneak Peek  (31)Solution Services  (4)Spreadsheet  (11)SQL  (14)Stock Chart  (1)Surface  (4)Tablets  (5)Theme  (12)Tips and Tricks  (113)UI  (393)Uncategorized  (68)Unix  (2)User interface  (68)Visual State Manager  (2)Visual Studio  (31)Visual Studio Code  (19)Web  (618)What's new  (334)Windows 8  (19)Windows App  (2)Windows Phone  (15)Windows Phone 7  (9)WinRT  (26)
Replicating an App Login Screen in Xamarin.Forms

Replicating an App Login Screen in Xamarin.Forms

Howdy! We are going to replicate an app login screen in Xamarin.Forms based on this Dribble design.

In this UI design, we have two separate pages for validating email and password.

We are going to break down this UI to explain the step-by-step procedure to create the following pages:

App Login Screen in Xamarin.Forms

Before starting, let’s highlight some significant points in our approach:

  • We will replicate a UI with XAML. To design the UI, we are going to use different components such as Frames, Label.FormattedText, and images. We will also use tips to handle overlapping controls.
  • We are going to implement Syncfusion Xamarin.Forms controls such as Masked Entry (SfMaskedEdit) for email validation and Avatar View (SfAvatarView) to set our login avatar.
  • We will learn how to build designs in a specific orientation (like in the Facebook app).

Let’s code!

Step 1: Main picture block and main layout structure

Let’s create a background by adding an image as shown below. To achieve this, we use the Grid to place the image and establish the main layout for the screen.

Pay attention to this step because we will implement it on this screen and the next!

Main Picture in Xamarin.FormsRefer to the following code example.

<!-- Main structure-->
  <Grid RowDefinitions="*,Auto">
     <!--Main image-->
     <Image Grid.RowSpan="2" Source="Model" VerticalOptions="Start" Aspect="AspectFit"/>
     <!—Content of the step 2 and 3 goes here -->


Step 2: Frame information

Frame information in Xamarin.Forms
Let’s continue with designing the Frame information block! We have a set of controls to present the required information.


Here, we are going to display the text “Hi!” just before the frame design. Refer to the following code example.

<!-- Title-->
 <Label Grid.Row="0" Text="Hi!" FontSize="34" TextColor="White" VerticalOptions="End" FontAttributes="Bold" Padding="20,0,0,20"/>

 <!-- Content of next step goes here -->

Information frame body 

Now, add the frame and the layout to organize the information in it.

<!--Information Frame-->
  <Frame Grid.Row="1" HasShadow="False" Margin="15,0,15,50" VerticalOptions="FillAndExpand" CornerRadius="20" Opacity="0.9" BackgroundColor="#2e2b2c">
   <Grid RowDefinitions="Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto" RowSpacing="25" Padding="0,10,0,0">
       <!— Content of next step goes here -->        

Information frame details

The frame contains the following components:


To integrate and validate the email address text box, we will use the Syncfusion Xamarin.Forms Masked Entry control. For more details, check the Getting Started with Xamarin.Forms Masked Entry documentation.

Refer to the following code example.

<!--Email validation with Syncfusion Masked Entry control-->
  <syncmaskededit:SfMaskedEdit Grid.Row="0" Watermark="Email" Mask="\w+@\w+\.\w+" MaskType="RegEx" HeightRequest="50"/>

  <!-- Content of next step goes here -->

Social networks

We will use Syncfusion Xamarin.Forms Button control to design the Continue and social network buttons (Continue with Facebook, Google, and Apple). For more details, check the Getting Started with Xamarin Button documentation.

Refer to the following code example.

<!--Syncfusion Buttons control--> 
  <buttons:SfButton Grid.Row="1" Text="Continue" Style="{StaticResource Highlighted}"/>
  <Label Grid.Row="2" Text="or" VerticalTextAlignment="Center" HorizontalTextAlignment="Center" TextColor="White"/>
  <buttons:SfButton Grid.Row="3" ImageSource="Facebook" Text="Continue with Facebook" Style="{StaticResource SocialNetworks}" />
  <buttons:SfButton Grid.Row="4" ImageSource="Google" FontSize="17" Text="Continue with Google" Style="{StaticResource SocialNetworks}"/>
  <buttons:SfButton Grid.Row="5" ImageSource="Apple" FontSize="17" Text="Continue with Apple" Style="{StaticResource SocialNetworks}" />

  <!— Content of next step goes here -->


We are going to use a label to add all additional registration options (Don’t have an account? Forgot your password?). We are using the same label for these options but with different styles. To save time and for better app performance, we are using Label.FormattedText. It allows us to customize the size and style within the same Label. For more details, refer to this article on best practices for UI handling.

Refer to the following code example.

<Label Grid.Row="6" Margin="0,10,0,0">
        <Span Text="Don't have an account? " TextColor="White"/>
        <Span Text="Sign Up" TextColor="{StaticResource MainColor}" FontAttributes="Bold"/>

<Label Grid.Row="7" Text="Forget your password?" TextColor="{StaticResource MainColor}" FontAttributes="Bold"/>

We’re done with our first screen !!

Step 3: Login information

Now, let’s continue with the replica of the second screen!

Login information in Xamarin.FormsLet’s name this page Log In. We’ll use the same main layout structure as on the previous page.

Refer to the following code example.

<!-- Main structure-->
<Grid RowDefinitions="*,*">
  <!--Main image-->
  <Image Grid.Row="0"  Source="Model" VerticalOptions="Start" Aspect="AspectFill"/>
  <!-- Main information-->
  <Label Grid.Row="0" Text="Log In" FontSize="36" TextColor="White" FontAttributes="Bold" Padding="20,0,0,30" VerticalOptions="CenterAndExpand"/>
  <!— Content of next step goes here -->      

Now, let’s design the structure of the frame and its layout in addition to the avatar view on the login page.

Frame and grid

Refer to the following code example.

<Frame Grid.Row="0" Grid.RowSpan="2" HasShadow="False" Padding="25,50" Margin="10,0,10,40" VerticalOptions="CenterAndExpand" CornerRadius="20" Opacity="0.9" BackgroundColor="#2e2b2c">
 <Grid ColumnDefinitions="Auto,*" RowDefinitions="*,Auto,Auto,Auto,Auto" RowSpacing="15">
    <!— Content of next step goes here -->              

Avatar view

To add the avatar image, I am going to use Syncfusion Xamarin.Forms Avatar View control. To do so, we have to add Syncfusion.Xamarin.Core NuGet package and then include the following namespace.


Next, we add the implementation logic for the Avatar View control, followed by the name and email as avatar information.

<sfavatar:SfAvatarView ContentType="Custom" Grid.Column="0" Grid.Row="0" Grid.RowSpan="2"

 <!-- Avatar information-->
   <Label Grid.Column="1" Grid.Row="0" Text="Jane Dow" FontAttributes="Bold" TextColor="White" FontSize="19" VerticalTextAlignment="End"/>
   <Label Grid.Column="1" Grid.Row="1" Text="" TextColor="White" VerticalTextAlignment="Start"/>

 <!-- Content of next step goes here -->

Password validation

Finally, we add the password field, the Continue button to send the information (using the Syncfusion Xamarin.Forms Button), and the label to retrieve a forgotten password.

Refer to the following code example.

<Entry Grid.ColumnSpan="2" Margin="0,20,0,0" Grid.Row="2" IsPassword="True" Placeholder="********" HeightRequest="50"/>
    <buttons:SfButton Grid.ColumnSpan="2" Grid.Row="3" Text="Continue" Style="{StaticResource Highlighted}" />
    <Label Grid.ColumnSpan="2" Grid.Row="4" Text="Forgot your password?" TextColor="{StaticResource MainColor}" FontAttributes="Bold"/&gt

And our UI is done!

GitHub reference

Check out our complete example code for replicating an app login screen in Xamarin.Forms on GitHub.


Thanks for reading! In this blog, we have seen how to replicate an app login screen using Syncfusion Xamarin.Forms UI controls. Try out the steps provided here and leave your feedback in the comments section below!

Syncfusion’s Xamarin suite offers over 150 UI controls, from basic editors to powerful, advanced controls like DataGridChartsListView, and Rich Text Editor. Use them to build elite applications!

You can contact us through our support forumsupport tickets, or feedback portal. We are always happy to assist you!

Related blogs


Share this post:

Popular Now

Be the first to get updates

Subscribe RSS feed

Be the first to get updates

Subscribe RSS feed