728x90
반응형
728x170
▶ MauiProgram.cs
namespace TestProject;
/// <summary>
/// MAUI 프로그램
/// </summary>
public static class MauiProgram
{
//////////////////////////////////////////////////////////////////////////////////////////////////// Method
////////////////////////////////////////////////////////////////////////////////////////// Static
//////////////////////////////////////////////////////////////////////////////// Public
#region MAUI 앱 생성하기 - CreateMauiApp()
/// <summary>
/// MAUI 앱 생성하기
/// </summary>
/// <returns>MAUI 앱</returns>
public static MauiApp CreateMauiApp()
{
MauiAppBuilder builder = MauiApp.CreateBuilder();
builder
.UseMauiApp<App>()
.ConfigureFonts
(
fontCollection =>
{
fontCollection.AddFont("OpenSans-Regular.ttf" , "OpenSansRegular" );
fontCollection.AddFont("OpenSans-Semibold.ttf", "OpenSansSemibold");
fontCollection.AddFont("ionicons.ttf" , "ionicons" );
}
);
return builder.Build();
}
#endregion
}
728x90
▶ MainPage.xaml
<?xml version="1.0" encoding="utf-8" ?>
<ContentPage x:Class="TestProject.MainPage"
xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml">
<StackLayout
HorizontalOptions="Center"
VerticalOptions="Center"
Orientation="Horizontal"
Spacing="10">
<Image>
<Image.Source>
<FontImageSource
FontFamily="ionicons"
Size="48"
Color="Red"
Glyph="" />
</Image.Source>
</Image>
<Image>
<Image.Source>
<FontImageSource
FontFamily="ionicons"
Size="48"
Color="Green"
Glyph="" />
</Image.Source>
</Image>
<Image>
<Image.Source>
<FontImageSource
FontFamily="ionicons"
Size="48"
Color="Blue"
Glyph="" />
</Image.Source>
</Image>
</StackLayout>
</ContentPage>
728x90
반응형
그리드형(광고전용)
'C# > MAUI' 카테고리의 다른 글
[C#/MAUI/.NET6] Color 클래스 : FromRgb 정적 메소드를 사용해 색상 구하기 (0) | 2022.06.01 |
---|---|
[C#/MAUI/.NET6] Color 클래스 : FromHsla 정적 메소드를 사용해 색상 구하기 (0) | 2022.06.01 |
[C#/MAUI/.NET6] Color 클래스 : FromHex 정적 메소드를 사용해 색상 구하기 (0) | 2022.06.01 |
[C#/MAUI/.NET6] Color 클래스 : XAML에서 색상 값 사용하기 (0) | 2022.06.01 |
[C#/MAUI/.NET6] GraphicsView 엘리먼트 : Drawable 속성 사용하기 (0) | 2022.06.01 |
[C#/MAUI/.NET6] Page 클래스 : DisplayPromptAsync 메소드를 사용해 메시지 박스에서 입력받기 (0) | 2022.06.01 |
[C#/MAUI/.NET6] Page 클래스 : DisplayActionSheet 메소드를 사용해 메시지 박스 표시하기 (0) | 2022.06.01 |
[C#/MAUI/.NET6] Page 클래스 : DisplayActionSheet 메소드를 사용해 메시지 박스 표시하기 (0) | 2022.06.01 |
[C#/MAUI/.NET6] Page 클래스 : DisplayAlert 메소드를 사용해 메시지 박스 표시하기 (0) | 2022.06.01 |
[C#/MAUI/.NET6] MenuBarItem 엘리먼트 사용하기 (UWP) (0) | 2022.05.31 |
댓글을 달아 주세요