зеркало из https://github.com/jsuarezruiz/HotUI.git
Fixed a crash on android
This commit is contained in:
Родитель
87742eac9b
Коммит
5633dbddda
|
@ -82,9 +82,11 @@ namespace HotUI.Android.Handlers
|
|||
foreach (var child in children)
|
||||
{
|
||||
var cview = child.ToView();
|
||||
views.Add(cview);
|
||||
//cview.ContentMode = UIViewContentMode.Top;
|
||||
base.AddView(cview);
|
||||
if (cview != null)
|
||||
{
|
||||
views.Add(cview);
|
||||
base.AddView(cview);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -6,32 +6,39 @@ namespace HotUI.Android
|
|||
{
|
||||
public static class UI
|
||||
{
|
||||
static bool hasInit;
|
||||
static bool _hasInitialized;
|
||||
|
||||
public static void Init()
|
||||
{
|
||||
if (hasInit)
|
||||
return;
|
||||
hasInit = true;
|
||||
if (_hasInitialized) return;
|
||||
_hasInitialized = true;
|
||||
|
||||
// Controls
|
||||
Registrar.Handlers.Register<Button, ButtonHandler>();
|
||||
Registrar.Handlers.Register<Toggle, ToggleHandler>();
|
||||
Registrar.Handlers.Register<Image, ImageHandler>();
|
||||
Registrar.Handlers.Register<TextField, TextFieldHandler>();
|
||||
Registrar.Handlers.Register<Text, TextHandler>();
|
||||
Registrar.Handlers.Register<VStack, VStackHandler>();
|
||||
Registrar.Handlers.Register<HStack, HStackHandler>();
|
||||
Registrar.Handlers.Register<Toggle, ToggleHandler>();
|
||||
//Registrar.Handlers.Register<WebView, WebViewHandler> ();
|
||||
|
||||
// Containers
|
||||
Registrar.Handlers.Register<ScrollView, ScrollViewHandler>();
|
||||
Registrar.Handlers.Register<Image, ImageHandler> ();
|
||||
Registrar.Handlers.Register<ListView, ListViewHandler> ();
|
||||
Registrar.Handlers.Register<View, ViewHandler>();
|
||||
Registrar.Handlers.Register<ContentView, ContentViewHandler>();
|
||||
Registrar.Handlers.Register<ViewRepresentable, ViewRepresentableHandler>();
|
||||
|
||||
Device.PerformInvokeOnMainThread = (a) => AndroidContext.CurrentContext.RunOnUiThread(a);
|
||||
Device.GraphicsService = new AndroidGraphicsService();
|
||||
// Native Layouts
|
||||
Registrar.Handlers.Register<HStack, HStackHandler>();
|
||||
Registrar.Handlers.Register<VStack, VStackHandler>();
|
||||
|
||||
// Modal SUpport
|
||||
ModalView.PerformPresent = ModalManager.ShowModal;
|
||||
ModalView.PerformDismiss = ModalManager.DismisModal;
|
||||
|
||||
// Device Services
|
||||
Device.PerformInvokeOnMainThread = (a) => AndroidContext.CurrentContext.RunOnUiThread(a);
|
||||
Device.GraphicsService = new AndroidGraphicsService();
|
||||
}
|
||||
}
|
||||
}
|
Загрузка…
Ссылка в новой задаче