본문 바로가기

FRAME WORK/Xamarin

[Xamarin] 자마린 페이지 빌드하기

 

<?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:xct="http://xamarin.com/schemas/2020/toolkit"
             xmlns:tool="http://xamarin.com/schemas/2020/toolkit"
             xmlns:ios="clr-namespace:Xamarin.Forms.PlatformConfiguration.iOSSpecific;assembly=Xamarin.Forms.Core" 
             ios:Page.UseSafeArea="true"
			 xmlns:local ="clr-namespace:App6"
             x:Class="App6.SB_CARD_001_0001">
             
    <ContentPage.Content>
    	<StackLayout StyleClass="wrap">
        	<!-- header -->
            <FlexLayout StyleClass="header_wrap" AlignItems="Center" JustifyContent="Start" HeightRequest="60">
                <Button ImageSource="{local:ImageResource App6.Assets.Property1arrow@3x.png}" Rotation="180" WidthRequest="24" HeightRequest="24" BackgroundColor="Transparent" Margin="16,0,0,0"></Button>
                <Label Text="복합결제" FontFamily="NotoSansBold" FontSize="18" FontAttributes="Bold" TextColor="#FF222222" Margin="8,0,0,0"></Label>
            </FlexLayout>
            
            <!-- contents -->
            <ScrollView HeightRequest="216" Padding="32,0,32,0" Margin="0,7,0,0">
                <StackLayout>
                    <Label Text="일시불" FontFamily="NotoSansMedium" FontSize="16" TextColor="#FF222222" Margin="0,0,0,24"></Label>
                    <Label Text="2개월 무이자" FontFamily="NotoSansMedium" FontSize="16" TextColor="#FF222222" Margin="0,0,0,24"></Label>
                    <Label Text="3개월 무이자" FontFamily="NotoSansMedium" FontSize="16" TextColor="#FF222222" Margin="0,0,0,24"></Label>
                    <Label Text="4개월" FontFamily="NotoSansMedium" FontSize="16" TextColor="#FF222222" Margin="0,0,0,24"></Label>
                    <Label Text="5개월" FontFamily="NotoSansMedium" FontSize="16" TextColor="#FF222222"></Label>
                </StackLayout>
            </ScrollView>
            
            <!-- footer -->
            <StackLayout class="footer_wrap">
                <Button Style="{StaticResource btn_on_black}" Text="닫기" HeightRequest="56" FontSize="18"></Button>
            </StackLayout>
        </StackLayout>
	</ContentPage.Content>
</ContentPage>

 

위의 컨텐츠 페이지를 만들었다.

빌드해보자

App.xaml.cs 페이지에 빌드할 페이지 클래스 명을 쓰고 ( MainPage = new 페이지클래스명(); ) 아래의 버튼을 눌러주면 끝.

 

using System;
using System.Reflection;
using Xamarin.Forms;
using Xamarin.Forms.Xaml;




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

            MainPage = new SB_CARD_001_0001();
        }

        protected override void OnStart()
        {
        }

        protected override void OnSleep()
        {
        }

        protected override void OnResume()
        {
        }
        private ImageSource GetResourceImage(string source)
        {
            return ImageSource.FromResource(source, typeof(ImageResourceExtension).GetTypeInfo().Assembly);
        }
    }
}
반응형