Wednesday 25 October 2017

Xamarin Forms Profile UI Design[Tutorial 16]




Step1:
App.Xaml.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using Xamarin.Forms;

namespace ProfileUi
{
 public partial class App : Application
 {
  public App ()
  {
   InitializeComponent();

   MainPage = new ProfileUi.MainPage();
  }

  protected override void OnStart ()
  {
   // Handle when your app starts
  }

  protected override void OnSleep ()
  {
   // Handle when your app sleeps
  }

  protected override void OnResume ()
  {
   // Handle when your app resumes
  }
 }
}

Step:2
MainPage.Xaml

<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
             xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
             xmlns:local="clr-namespace:ProfileUi"
             x:Class="ProfileUi.MainPage"
             BackgroundColor="Black">
    <ContentPage.Content>
        <StackLayout>
            <Image Aspect="AspectFill" Source="http://d.ibtimes.co.uk/en/full/1611491/cristiano-ronaldo.jpg"/>
            <BoxView HeightRequest="1" BackgroundColor="#ffffff"
               />
            <StackLayout Padding="15">

                <Label Text="Cristiano Ronaldo" FontAttributes="Bold" TextColor="White"/>
                <Label Text="My comments were misinterpreted after the game. I wasn't saying that I'm better than everyone else. I was referring to injuries. The team have lost a lot of important players through injury like Pepe, Bale, Benzema, Marcelo… That has harmed us and prevented us from reaching our usual level."
                      TextColor="White" />

            </StackLayout>

            <BoxView HeightRequest="1" BackgroundColor="#ffffff"/>


            <StackLayout Orientation="Horizontal" VerticalOptions="Center" HorizontalOptions="Center"/>
            <Button Text="NextPage"/>
        </StackLayout>
    </ContentPage.Content>
</ContentPage>



Step3:
MainPage.Xaml.cs


using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Xamarin.Forms;

namespace ProfileUi
{
 public partial class MainPage : ContentPage
 {
  public MainPage()
  {
   InitializeComponent();
  }
 }
}
Step4:
No More Work Holaa!!! You Will Get Expected OutPut.. :D

No comments:

Post a Comment