【发布时间】:2017-11-20 22:19:20
【问题描述】:
我不知道为什么 DisplayAlert 不起作用,如果我写 page.Displayalert 它也不起作用
使用系统;
使用 Xamarin.Forms;
使用 UIKit;
命名空间 test.project { 公共部分类 ViewController : UIViewController {
partial void UIButton197_TouchUpInside(UIButton sender)
{
if(textBoxName.Text == "" && textBoxpasswd.Text == "")
{
await displayAlert("Hello");
}
}
protected ViewController(IntPtr handle) : base(handle)
{
// Note: this .ctor should not contain any initialization logic.
}
public override void ViewDidLoad()
{
base.ViewDidLoad();
// Perform any additional setup after loading the view, typically from a nib.
}
public override void DidReceiveMemoryWarning()
{
base.DidReceiveMemoryWarning();
// Release any cached data, images, etc that aren't in use.
}
}
}
【问题讨论】:
-
DisplayAlert 是 Page 上的一个方法,一个 XF 类。您正在尝试从特定于 iOS 的 ViewController 中调用它。
-
那我应该在哪里写呢?
-
为什么要在 XF 项目中创建仅 iOS 页面?
标签: xamarin