mirror of
https://gitee.com/csharpui/CPF.git
synced 2026-04-17 19:18:03 +08:00
初始化
This commit is contained in:
28
AndroidTest/MainActivity.cs
Normal file
28
AndroidTest/MainActivity.cs
Normal file
@@ -0,0 +1,28 @@
|
||||
using Android.App;
|
||||
using Android.OS;
|
||||
//using Android.Runtime;
|
||||
//using AndroidX.AppCompat.App;
|
||||
using CPF.Platform;
|
||||
|
||||
namespace AndroidTest
|
||||
{
|
||||
[Activity(Label = "@string/app_name", MainLauncher = true)]
|
||||
public class MainActivity : CPF.Android.CpfActivity
|
||||
{
|
||||
static MainActivity()
|
||||
{
|
||||
CPF.Platform.Application.Initialize((OperatingSystemType.Android, new CPF.Android.AndroidPlatform(), new CPF.Skia.SkiaDrawingFactory { ClearType = true, UseGPU = true }));
|
||||
}
|
||||
|
||||
protected override void OnCreate(Bundle savedInstanceState)
|
||||
{
|
||||
//Window.SetSoftInputMode(SoftInput.AdjustResize);
|
||||
base.OnCreate(savedInstanceState);
|
||||
ClassLibrary1.Class1.CreateNativeControl = () => new global::Android.Widget.Button(this) { Text = "原生控件" };
|
||||
SetContentView(new CPF.Android.CpfView(new ClassLibrary1.Class1()));
|
||||
//this.Window.AddContentView();
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user