Ios Xamarin弹出导航控制器不显示节页脚视图
我想在Xamarin.iOS中实现弹出式导航。为此,我使用了FlyoutNavigationController,到目前为止它运行良好 但现在我必须在弹出式菜单的导航列表下方显示一些附加内容(基本上是图像、一些标签和按钮)。为此,我想使用保存菜单项的“section”控件的FooterView属性 当我设定Ios Xamarin弹出导航控制器不显示节页脚视图,ios,xamarin,Ios,Xamarin,我想在Xamarin.iOS中实现弹出式导航。为此,我使用了FlyoutNavigationController,到目前为止它运行良好 但现在我必须在弹出式菜单的导航列表下方显示一些附加内容(基本上是图像、一些标签和按钮)。为此,我想使用保存菜单项的“section”控件的FooterView属性 当我设定 section.Footer = "Test"; 它会起作用(我可以看到文本),但当我使用“FooterView”属性时,什么都不会显示: public class ViewControl
section.Footer = "Test";
它会起作用(我可以看到文本),但当我使用“FooterView”属性时,什么都不会显示:
public class ViewController : UIViewController
{
FlyoutNavigationController navigation;
private const string PageNamePage1 = "The first page";
private const string PageNamePage2 = "The second page";
readonly string[] pages =
{
PageNamePage1,
PageNamePage2
};
public override void ViewDidLoad()
{
base.ViewDidLoad();
navigation = new FlyoutNavigationController
{
View =
{
Frame = UIScreen.MainScreen.Bounds
}
};
View.AddSubview(navigation.View);
var elements = pages.Select(page => new StringElement(page) as Element);
navigation.NavigationRoot = new RootElement("Induserv App");
var section = new Section();
section.AddAll(elements);
var uiTextView = new UITextView {Text = "--> This won't show!"};
section.FooterView = new UIView
{
uiTextView
};
navigation.NavigationRoot.Add(section);
navigation.ViewControllers = new UIViewController[]
{
new UINavigationController(new Page1Controller(navigation, PageNamePage1)),
new UINavigationController(new Page2Controller(navigation, PageNamePage2)),
};
}
}
有人知道在这里显示这个页脚需要什么吗?是否有其他方法可以在此面板中放置一些控件?为页脚视图和uiTextView设置一个框架,如下所示:
var uiTextView = new UITextView(new RectangleF(0, 0, 10, 10)) {Text = "--> This won't show!"};
section.FooterView = new UIView(new RectangleF(0, 0, 10, 10))
{
uiTextView
};
你确定UITextView有一些尺寸吗?@choper,谢谢你的回复。我试过设置大小,但还是没有显示。谢谢,@Alexandra。根据你的建议,我可以让它工作,不过我必须将大小增加到200左右才能真正看到一些东西。此外,UIView的宽度被忽略,它只是拉伸到菜单的宽度。