如何使用Xamarin实现帮助页面?

时间:2017-04-28 10:58:49

标签: xamarin xamarin.forms

我有几页的Xamarin Forms应用程序,我想实现帮助页面。我想帮助成为原始页面顶部的半透明层。该图层将包含解释功能的箭头和文本。有什么提示怎么做?

2 个答案:

答案 0 :(得分:2)

我认为弹出窗口可以帮助你

这是我经常使用的plugin

您可以创建自定义页面并在页面前面推/弹它

// Use these methods in PopupNavigation globally or Navigation in your pages

// Open new PopupPage
Task PushAsync(PopupPage page, bool animate = true) // Navigation.PushPopupAsync

// Hide last PopupPage
Task PopAsync(bool animate = true) // Navigation.PopPopupAsync

// Hide all PopupPage with animations
Task PopAllAsync(bool animate = true) // Navigation.PopAllPopupAsync

// Remove one popup page in stack
Task RemovePageAsync(PopupPage page, bool animate = true) // Navigation.RemovePopupPageAsync

答案 1 :(得分:0)

您可以通过创建可在整个Xamarin Forms页面中重复使用的自定义View来实现此目的。如果绑定视图,则可以通过每个ViewModel为给定页面提供相应的帮助文本。通过将视图可见性绑定到是否点击了信息按钮,您可以根据需要显示和隐藏它。

<local:HelpView Text="{Binding HelpText}" IsVisible="{Binding ShowHelp}" />