标签:android style blog http io ar color os sp
添加变量:private static bool _initialized;修改MainActivity集成自:XFormsApplicationDroid添加方法:
private void SetIoc() { var resolverContainer = new SimpleContainer(); var app = new XFormsAppDroid(); app.Init(this); resolverContainer.Register<IDevice>(t => AndroidDevice.CurrentDevice) .Register<IDisplay>(t => t.Resolve<IDevice>().Display) .Register<IDependencyContainer>(resolverContainer) .Register<IXFormsApp>(app); Resolver.SetResolver(resolverContainer.GetResolver()); _initialized = true; }
if (!_initialized) { this.SetIoc(); }
从零开始学Xamarin.Forms(四) Android 准备步骤(添加第三方Xamarin.Forms.Labs库)
标签:android style blog http io ar color os sp
原文地址:http://blog.csdn.net/zapzqc/article/details/41746643