首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Xamarin IOS Fly Out导航

Xamarin IOS Fly Out导航
EN

Stack Overflow用户
提问于 2015-05-11 06:25:58
回答 1查看 758关注 0票数 0

我正在使用IOS的这个飞出导航,我想在顶部的导航上添加一个图像和文本,我该怎么做?

像这样的https://github.com/garuma/FlyOutMenu,上面写着一个标题,但我用一个图像和文本替换了那个标题,我该如何使用Clancey Fly Out导航来实现这一点

代码语言:javascript
复制
https://github.com/Clancey/FlyoutNavigation

编辑:这是我尝试过的

代码语言:javascript
复制
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)" } },
        },
    };
EN

回答 1

Stack Overflow用户

发布于 2015-09-18 18:43:45

使用"ImageElement“将图片添加到您的FlyOut。

代码语言:javascript
复制
public override void ViewDidLoad ()

{

代码语言:javascript
复制
    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)" } },
        },
    };
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/30157284

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档