如何在 Xamarin Forms 中设置自动日/夜模式谷歌地图 [英] How set auto day/night mode google maps in Xamarin Forms

查看:39
本文介绍了如何在 Xamarin Forms 中设置自动日/夜模式谷歌地图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要设置夜间模式谷歌地图,它将使用手机中的传感器自动工作,使用开关手动工作.我需要一些示例或文档

I need to set the night mode Google maps, which will work automatically using the sensor in the phone and manual using the switch. I need some example or documentation

推荐答案

安装 Xamarin.Forms.GoogleMaps Nuget 包(源代码可在 GitHub)已经在 Xamarin.Forms 上实现了它.

Install the Xamarin.Forms.GoogleMaps Nuget Package (source code available on GitHub) which has already implemented it on Xamarin.Forms.

您可以参考可用的 MapStylePage 示例 此处 基本上解释了如何使用 MapStyle With Google 创建原始地图样式.您可以使用向导,从那里选择 Night 主题并获取相应的 json 样式,您将在 Xamarin 应用程序中使用该样式.

You can refer to the MapStylePage sample available here which basically explains you how to create original map styles using MapStyle With Google. You can use the wizard, select the Night theme from there and get the corresponding json style, which you'll use on your Xamarin app.

这篇关于如何在 Xamarin Forms 中设置自动日/夜模式谷歌地图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆