【发布时间】:2016-03-22 10:03:32
【问题描述】:
早上好,
我正在 Xamarin.Forms 中开发一个小的跨平台 webview 项目。我有 webview 工作,但我想添加一个工具栏,它有一个后退和前进按钮。
我尝试了许多不同的方法,但似乎都没有特别好的方法。我试图通过关注这个人的帖子Navigation Toolbar来实现这个功能
我将在下面附上我的代码,如果有人可以帮我解决这个问题或提供一个很棒的解决方案!
如果这个问题之前已经被其他用户回答过,那么我很抱歉。
App.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Xamarin.Forms;
namespace DisplayWebPage
{
public class App : Application
{
public App()
{
// The root page of your application
MainPage = new WebPage();
}
protected override void OnStart()
{
// Handle when your app starts
}
protected override void OnSleep()
{
// Handle when your app sleeps
}
protected override void OnResume()
{
// Handle when your app resumes
}
}
}
WebPage.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection.Emit;
using System.Text;
using Xamarin.Forms;
namespace DisplayWebPage
{
public class WebPage : ContentPage
{
public WebPage()
{
Content = new StackLayout
{
Children = {
new WebView
{
Source = "http://www.google.com"
}
}
};
}
}
}
期待得到答案,因为我已经坚持了很长一段时间了。
亲切的问候
【问题讨论】:
标签: c# android ios webview xamarin.forms