android - MasterDetailPage Xamarin Android 中的 native View

标签 android google-maps xamarin xamarin.forms

我有一个我正在尝试创建的 map View ,但它比 map 实现更高级 由 Xamarin.Forms 提供。我想知道是否有用于嵌入 native View 的模式 主详细信息页面。

在示例图像中,顶部导航栏将在 Xamarin 中构建,以紫色突出显示的内容部分应根据平台单独创建。

enter image description here

最佳答案

这通常是渲染器可以接管的地方。

参见 Customizing Controls for Each PlatformForms2Native样本。

您将创建一个 MapContentPage 来扩展 ContentPage 并在顶部有一个属性:

[assembly: ExportRenderer (typeof (MapContentPage), typeof (MapContentPageRenderer))]

然后您将为 Android 创建一个名为 MapContentPageRenderer 的渲染器,并在其 OnElementChanged 中,您将使用“常规”Mono 为 Android 代码实例化 map 。

关于android - MasterDetailPage Xamarin Android 中的 native View ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26347455/

相关文章:

android - 初始化期间 Phonegap 插件错误

google-maps - Apple Maps 和 Google Maps API 的参数相同吗?

xamarin - 无法在 Xamarin.iOS 上 AOT Microsoft.CSharp.dll 的程序集

android - 实时视频流在 Android 中如何工作?

android - 编译Kivy项目并使用Android模拟器运行

google-maps - 从Google Maps Embed iframe删除黑色标题

android - 更改 android View 的位置似乎会更改动画枢轴

c# - Xamarin Forms - WebViewSource 显示空白页

android - 当显示键盘时,我的 Android AlertDialog 没有向上移动

javascript - 从 JSON 中的 servlet 请求获取纬度和经度并在谷歌地图对象中打印出来