MvvmCross - 使用Storyboard时,MvxTabBarViewController不显示“更多”按钮

时间:2015-01-05 10:42:10

标签: xamarin.ios xamarin mvvmcross uitabbar

在我的应用程序中,我使用 MvxTabBarViewController 显示一些标签(使用故事板加载 MvxTabBarViewController ):

public partial class RootView : MvxTabBarViewController
    {
        private int _tabIndex = 0;

        private Dictionary<int, SectionBase> _sectionBaseForConfig;

        public new RootViewModel ViewModel
        {
            get { return (RootViewModel)base.ViewModel; }
            set { base.ViewModel = value; }
        }

        public RootView(IntPtr handle)
            : base(handle)
        {
        }

        UIViewController tab1, tab2, tab3, tab4, tab5, tab6, tab7;

        public override async void ViewDidLoad()
        {
            base.ViewDidLoad();

            if (ViewModel == null)
                return;

            tab1 = new UIViewController();
            tab1.Title = "1";
            tab1.View.BackgroundColor = UIColor.Green;
            tab2 = new UIViewController();
            tab2.Title = "2";
            tab2.View.BackgroundColor = UIColor.Orange;
            tab3 = new UIViewController();
            tab3.Title = "3";
            tab3.View.BackgroundColor = UIColor.Red;
            tab4 = new UIViewController();
            tab4.Title = "4";
            tab4.View.BackgroundColor = UIColor.Blue;
            tab5 = new UIViewController();
            tab5.Title = "5";
            tab5.View.BackgroundColor = UIColor.Brown;
            tab6 = new UIViewController();
            tab6.Title = "6";
            tab6.View.BackgroundColor = UIColor.Brown;
            tab7 = new UIViewController();
            tab7.Title = "7";
            tab7.View.BackgroundColor = UIColor.Brown;

            var tabs = new UIViewController[] {
                tab1, tab2, tab3, tab4, tab5, tab6, tab7
            };
            ViewControllers = tabs;

            CustomizableViewControllers = null;
            SelectedViewController = ViewControllers[0];
        }
    }

不幸的是,即使有7个标签,也只显示5个标签,并且&#34;更多&#34;按钮不显示。有人有个主意吗?我现在2小时就坚持这个问题,没有任何线索:(

谢谢!

0 个答案:

没有答案