예제 #1
0
        private void AddNavigationController()
        {
            var button = new UIBarButtonItem();
            button.Title = "Инфо";

            var controllers = new UIViewController[4];
            controllers [0] = GetController (@"Twitter", @"TabBar/icon_twitter.png");
            controllers [1] = GetController (@"Dribbble", @"TabBar/icon_dribbble.png");
            controllers [2] = GetController (@"Apple", @"TabBar/icon_apple.png");
            controllers [3] = GetController (@"GitHub", @"TabBar/icon_github.png");

            var navi = new UINavigationController ();
            var tabBarController = new UITabBarController();
            tabBarController.ViewControllers = controllers;
            navi.PushViewController (tabBarController, true);

            button.Clicked += (sender, e) => {
                InfoScreen infoScreen = new InfoScreen();
                navi.PushViewController (infoScreen, true);
            };
            navi.NavigationBar.TopItem.SetRightBarButtonItem (button, true);
            window.RootViewController = navi;
        }
예제 #2
0
        private void AddComponents()
        {
            _table = new UITableView ();
            //_table.Frame = new RectangleF(0,0, View.Frame.Width, View.Frame.Height);
            _table.RowHeight = 50;
            _table.BackgroundColor = UIColor.FromPatternImage(new UIImage (@"Tweets/bg.png"));
            Add (_table);

            var btn = UIButton.FromType (UIButtonType.RoundedRect);
            btn.SetTitle("Показать еще", UIControlState.Normal);
            btn.Font = UIFont.FromName("HelveticaNeue-Bold", 17);
            btn.Frame = new RectangleF (15, 5, View.Frame.Width - 30, 40);;
            btn.TouchUpInside += (sender, e) =>
            {
                _isLoaded= false;
                _alert.Show();
                _clickCount++;
                _twitterConection.GeTwittstByTag(_tag, GetNumberOfRows(true));
            };
            _tableSource.BtnAdd = btn;

            _btnInfo = new UIBarButtonItem ();
            _btnInfo.Title = "Инфо";
            _btnInfo.Clicked += (sender, e) => {
                InfoScreen infoScreen = new InfoScreen();
                NavigationController.PushViewController (infoScreen, true);
            };
            NavigationController.NavigationBar.TopItem.RightBarButtonItem = _btnInfo;

            SetFrame ();
        }