728x90
반응형
728x170
▶ TestProject.csproj
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net6.0-android;net6.0-ios;net6.0-maccatalyst</TargetFrameworks>
<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('windows'))">$(TargetFrameworks);net6.0-windows10.0.19041.0</TargetFrameworks>
<OutputType>Exe</OutputType>
<RootNamespace>TestProject</RootNamespace>
<UseMaui>true</UseMaui>
<SingleProject>true</SingleProject>
<ImplicitUsings>enable</ImplicitUsings>
<ApplicationTitle>TestProject</ApplicationTitle>
<ApplicationId>com.companyname.testproject</ApplicationId>
<ApplicationIdGuid>307F785A-6EDE-4AEB-8813-DC0FFA886398</ApplicationIdGuid>
<ApplicationDisplayVersion>1.0</ApplicationDisplayVersion>
<ApplicationVersion>1</ApplicationVersion>
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'ios'">14.2</SupportedOSPlatformVersion>
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'maccatalyst'">14.0</SupportedOSPlatformVersion>
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'android'">21.0</SupportedOSPlatformVersion>
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'windows'">10.0.17763.0</SupportedOSPlatformVersion>
<TargetPlatformMinVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'windows'">10.0.17763.0</TargetPlatformMinVersion>
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'tizen'">6.5</SupportedOSPlatformVersion>
<EmbedAssembliesIntoApk>true</EmbedAssembliesIntoApk>
</PropertyGroup>
<ItemGroup>
<MauiIcon Include="Resources\appicon.svg" ForegroundFile="Resources\appiconfg.svg" Color="#512bd4" />
<MauiSplashScreen Include="Resources\appiconfg.svg" Color="#512bd4" BaseSize="128,128" />
<MauiImage Include="Resources\Images\*" />
<MauiImage Update="Resources\Images\dotnet_bot.svg" BaseSize="168,208" />
<MauiFont Include="Resources\Fonts\*" />
<MauiAsset Include="Resources\Raw\**" LogicalName="%(RecursiveDir)%(Filename)%(Extension)" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="SkiaSharp.Extended.UI.Maui" Version="2.0.0-preview.59" />
</ItemGroup>
</Project>
※ "NuGet 패키지 관리" 메뉴의 "찾아보기" 탭에서 "시험판 포함" 체크 박스를 체크하고 [SkiaSharp.Extended.UI.Maui] 누겟을 참조한다.
300x250
▶ MauiProgram.cs
using SkiaSharp.Views.Maui.Controls.Hosting;
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>()
.UseSkiaSharp()
.ConfigureFonts
(
fontCollection =>
{
fontCollection.AddFont("OpenSans-Regular.ttf" , "OpenSansRegular" );
fontCollection.AddFont("OpenSans-Semibold.ttf", "OpenSansSemibold");
}
);
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"
xmlns:skia="clr-namespace:SkiaSharp.Extended.UI.Controls;assembly=SkiaSharp.Extended.UI">
<skia:SKLottieView
HorizontalOptions="Center"
VerticalOptions="Center"
WidthRequest="200"
HeightRequest="200"
RepeatCount="-1"
Source="dotnetbot.json" />
</ContentPage>
728x90
반응형
그리드형(광고전용)
'C# > MAUI' 카테고리의 다른 글
[C#/MAUI/.NET6] CommunityToolkit MVVM 패턴에서 명령에 인자 전달하기 (0) | 2022.07.28 |
---|---|
[C#/MAUI/.NET6] CommunityToolkit MVVM 패턴에서 속성 변경시 처리하기 (0) | 2022.07.28 |
[C#/MAUI/.NET6] CommunityToolkit MVVM 패턴 사용하기 (0) | 2022.07.28 |
[C#/MAUI/.NET6] 누겟 설치 : CommunityToolkit.Mvvm (0) | 2022.07.28 |
[C#/MAUI/.NET6] 누겟 설치 : SkiaSharp.Extended.UI.Maui (0) | 2022.07.26 |
[C#/MAUI/.NET6] VariableMultiValueConverter 클래스 : 복수 진리 값 → 단일 진리 값 변환자 사용하기 (0) | 2022.07.26 |
[C#/MAUI/.NET6] VariableMultiValueConverter 엘리먼트 : 복수 진리 값 → 단일 진리 값 변환자 사용하기 (0) | 2022.07.26 |
[C#/MAUI/.NET6] TextCaseConverter 클래스 : 텍스트 대소문자 변환자 사용하기 (0) | 2022.07.26 |
[C#/MAUI/.NET6] TextCaseConverter 엘리먼트 : 텍스트 대소문자 변환자 사용하기 (0) | 2022.07.26 |
[C#/MAUI/.NET6] StringToListConverter 클래스 : 문자열 → IEnumerable 변환자 사용하기 (0) | 2022.07.26 |
댓글을 달아 주세요