MonoTouch和MonoTouch.Dialog的新功能,但我确信可以创建一个标签栏或按钮栏或者你想要它的名字 - 黑色栏,iPhone底部带有图标/按钮。问题是如何使用MonoTouch.Dialog?
感谢您的帮助!
答案 0 :(得分:9)
这里有一些代码来展示它是多么容易:
class MyViewController : UINavigationController {
public MyViewController (string s)
{
TabBarItem = new UITabBarItem (s, null, 1);
var root = new RootElement (s) {
new Section (s) {
new StringElement (s)
}
};
PushViewController (new DialogViewController (root), false);
}
}
public override bool FinishedLaunching (UIApplication app, NSDictionary options)
{
window = new UIWindow (UIScreen.MainScreen.Bounds);
var nav = new UITabBarController ();
nav.ViewControllers = new UIViewController [] {
new MyViewController ("a"),
new MyViewController ("b"),
new MyViewController ("c")
};
nav.CustomizableViewControllers = new UIViewController [0];
window.RootViewController = nav;
window.MakeKeyAndVisible ();
return true;
}
给你类似的东西:
答案 1 :(得分:4)
你没有使用MT.Dialog。您将创建一个UITabBarController,然后为每个选项卡分配一个视图控制器。每个选项卡都可以指向MT.Dialog DialogViewController或任何其他类型的ViewController。