c# - 无法从“页面”转换为“Xamarin.Forms.Page”
问题描述
我想导航到 Xamarin Forms 中的其他页面,但它不起作用。我的代码是:
private async void btnlogin_Clicked(object sender, EventArgs e)
{ await Navigation.PushAsync(new CreateExpense());}
错误是:
无法从“页面”转换为“Xamarin.Forms.Page”。顺便说一下,“页面”在 contentView 中。
解决方案
您无法导航到内容视图,因此CreateExpense
应该使用Xamarin.Forms
并且应该继承ContentPage
,因此您应该执行以下操作CreateExpense
using Xamarin.Forms;
class CreateExpense : ContentPage
推荐阅读
- php - 将 IF 条件添加到现有的 FOREACH 循环
- rest - 带有 REST 调用的 Flutter onTap 以无限循环结束
- javascript - 表单提交按钮正在重定向而不是提交
- html - 如何使内容重叠的 div 随窗口大小缩放并居中?
- java - Eclipse 中的 Minecraft Forge 崩溃
- html - 使用 PayPal 帐户中提供的代码的 PayPal Buy Now 按钮会生成错误
- javascript - 柴间谍:expect().to.have.been.call() 在本地方法上失败
- python - marshmallow.fields.Nested() 函数中的属性到底是什么?
- python - 参数不正确的 PySide.QtWebKit.QWebFrame 加载方法
- gspread - NameError:名称“col_values”未定义