我正在使用IOS的这个飞出导航,我想在顶部的导航上添加一个图像和文本,我该怎么做?
像这样的https://github.com/garuma/FlyOutMenu,上面写着一个标题,但我用一个图像和文本替换了那个标题,我该如何使用Clancey Fly Out导航来实现这一点
https://github.com/Clancey/FlyoutNavigation编辑:这是我尝试过的
public override void ViewDidLoad ()
{
base.ViewDidLoad ();
var navigation = new FlyoutNavigationController {
// Create the navigation menu
NavigationRoot = new RootElement ("Navigation") {
MonkeyImage.Image = UIImage.FromBundle ("PurpleMonkey"); // This is what i tried adding here but it does not seen to work
new Section ("Pages") {
new StringElement ("Animals"),
new StringElement ("Vegetables"),
new StringElement ("Minerals"),
}
},
// Supply view controllers corresponding to menu items:
ViewControllers = new [] {
new UIViewController { View = new UILabel { Text = "Animals (drag right)" } },
new UIViewController { View = new UILabel { Text = "Vegetables (drag right)" } },
new UIViewController { View = new UILabel { Text = "Minerals (drag right)" } },
},
};发布于 2015-09-18 18:43:45
使用"ImageElement“将图片添加到您的FlyOut。
public override void ViewDidLoad (){
base.ViewDidLoad ();
var navigation = new FlyoutNavigationController {
// Create the navigation menu
NavigationRoot = new RootElement ("Navigation") {
MonkeyImage.Image = UIImage.FromBundle ("PurpleMonkey"); // This is what i tried adding here but it does not seen to work
new Section ("") {
new ImageElement (UIImage.FromBundle ("PurpleMonkey")),
},
new Section ("Pages") {
new StringElement ("Animals"),
new StringElement ("Vegetables"),
new StringElement ("Minerals"),
}
},
// Supply view controllers corresponding to menu items:
ViewControllers = new [] {
new UIViewController { View = new UILabel { Text = "Animals (drag right)" } },
new UIViewController { View = new UILabel { Text = "Vegetables (drag right)" } },
new UIViewController { View = new UILabel { Text = "Minerals (drag right)" } },
},
};https://stackoverflow.com/questions/30157284
复制相似问题