如何在 MonoTouch/MonoDevelop/Interface Builder 中创建新窗口/表单。 (苹果)
我在 MonoDevelop 中创建了我的第一个应用程序。我很难创建第二个窗口(表单)。
- 如果我创建一个新的 UIView,它会附加 .cs 和 .designer.cs 文件。它看起来不错,但它没有 appdelegate 来附加事件。
- 如果我使用新的 UIWindow,我不会附加 .cs 和 .designer.cs 文件。我也没有代表。
- 如果我复制原始的 MainWindow 并重命名它,它几乎可以工作,我有 delegate 和 .designer.cs 但它抱怨重复某些对象。像“Window”,“AppDelegate”
那么我应该如何创建一些需要一些按钮和事件来处理的新表单呢?
I have created my first application in MonoDevelop. I'm having difficulty to create a second window (form).
- If I create a new UIView it has .cs and .designer.cs files attached to it. It looks good, but it doesn't have appdelegate to attach events to.
- If I use the new UIWindow I don't have .cs and .designer.cs files attached to it. And I don't have delegates either.
- If I copy the original MainWindow and rename it, it almost works, I have delegate and .designer.cs but it complains about duplicating certain objects. Like "Window", "AppDelegate"
So how am I supposed to create some new forms that needs some buttons and events to deal with?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
在 iPhone 应用程序中,通常应该只有 1 个窗口。
使用您想要的元素创建一个新的 UIViewController,并将其呈现为其他控制器之上的“模态”视图控制器。它的功能与 ShowDialog() 类似,但它不是阻塞调用。
这些方法是 PresentModalViewController() 和 DismissModalViewControllerAnimated()。
这是一个不错的示例。
In an iPhone app, you should generally only have 1 window.
Create a new UIViewController with your desired elements, and present it as a "modal" view controller over your other controllers. It will function similar to ShowDialog(), except it won't be a blocking call.
The methods are PresentModalViewController() and DismissModalViewControllerAnimated().
Here is a decent example.