Skip to content

Commit 5aa6155

Browse files
authoredApr 5, 2024
Merge pull request #339 from dotnet/custom_renderer_multi
Added custom renderer sample
2 parents 85644dc + 04ac41b commit 5aa6155

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+8360
-0
lines changed
 
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
Any raw assets you want to be deployed with your application can be placed in
2+
this directory (and child directories) and given a Build Action of "AndroidAsset".
3+
4+
These files will be deployed with your package and will be accessible using Android's
5+
AssetManager, like this:
6+
7+
public class ReadAsset : Activity
8+
{
9+
protected override void OnCreate (Bundle bundle)
10+
{
11+
base.OnCreate (bundle);
12+
13+
InputStream input = Assets.Open ("my_asset.txt");
14+
}
15+
}
16+
17+
Additionally, some Android functions will automatically load asset files:
18+
19+
Typeface tf = Typeface.CreateFromAsset (Context.Assets, "fonts/samplefont.ttf");
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
<PropertyGroup>
3+
<OutputType>Exe</OutputType>
4+
<ImplicitUsings>enable</ImplicitUsings>
5+
<UseMaui>true</UseMaui>
6+
</PropertyGroup>
7+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
8+
<ConsolePause>false</ConsolePause>
9+
</PropertyGroup>
10+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
11+
<ConsolePause>false</ConsolePause>
12+
</PropertyGroup>
13+
<PropertyGroup>
14+
<TargetFramework>net8.0-android</TargetFramework>
15+
</PropertyGroup>
16+
<ItemGroup>
17+
<ProjectReference Include="..\CustomRenderer\CustomRenderer.csproj" />
18+
</ItemGroup>
19+
<ItemGroup>
20+
<PackageReference Include="Microsoft.DotNet.UpgradeAssistant.Extensions.Default.Analyzers" Version="0.4.410601">
21+
<PrivateAssets>all</PrivateAssets>
22+
</PackageReference>
23+
</ItemGroup>
24+
</Project>

0 commit comments

Comments
 (0)
Please sign in to comment.