Пример #1
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();
            TableView = new UITableView(new CGRect(0, 20, View.Frame.Width, View.Frame.Height - 30));
            string[] tableItems = new string[] { "Vegetables", "Fruits", "Flower Buds", "Legumes", "Bulbs", "Tubers" };
            Source = new TableSource(tableItems, TableView);
            this.TableView.Source = Source;
            // Perform any additional setup after loading the view, typically from a nib.

            View.AddSubview(TableView);

            var addBtn = new UIButton(new CGRect(20, 100, 100, 44));

            addBtn.SetTitle("Add", UIControlState.Normal);
            addBtn.SetTitleColor(UIColor.Orange, UIControlState.Normal);
            addBtn.TouchUpInside += (s, e) =>
            {
                Source.Add("TestData : " + r.Next(1000, 10000));
            };

            View.AddSubview(addBtn);
            TableView.AddLegendHeaderWithRefreshingBlock(() =>
            {
                for (int i = 0; i < 10; i++)
                {
                    Source.Add("TestData : " + r.Next(1000, 10000));
                }
                TableView.HeaderEndRefreshing();
            });
        }
Пример #2
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();
            TableView = new UITableView(new CGRect(0, 20, View.Frame.Width, View.Frame.Height - 30));
            string[] tableItems = new string[] { "Vegetables", "Fruits", "Flower Buds", "Legumes", "Bulbs", "Tubers" };
            Source = new TableSource(tableItems, TableView);
            this.TableView.Source = Source;
            // Perform any additional setup after loading the view, typically from a nib.

            View.AddSubview(TableView);

            var addBtn = new UIButton(new CGRect(20, 100, 100, 44));

            addBtn.SetTitle("Add", UIControlState.Normal);
            addBtn.SetTitleColor(UIColor.Orange, UIControlState.Normal);
            addBtn.TouchUpInside += (s, e) =>
            {
                Source.Add("TestData : " + r.Next(1000, 10000));
            };

            View.AddSubview(addBtn);

            var header = new MJRefreshNormalHeader();

            TableView.SetHeader(header);

            header.RefreshingBlock = async() =>
            {
                Source.Add("TestData : " + r.Next(1000, 10000));
                await Task.Delay(1000);

                header.EndRefreshing();
            };

            header.SetTitle("AA", MJRefreshState.Idle);
            header.SetTitle("BB", MJRefreshState.Pulling);
            header.SetTitle("CC", MJRefreshState.Refreshing);
            header.LastUpdatedTimeLabel.Hidden = true;
        }
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();
            TableView = new UITableView(new CGRect(0, 20, View.Frame.Width, View.Frame.Height - 30));
            string[] tableItems = new string[] { "Vegetables", "Fruits", "Flower Buds", "Legumes", "Bulbs", "Tubers" };
            Source = new TableSource(tableItems, TableView);
            this.TableView.Source = Source;
            // Perform any additional setup after loading the view, typically from a nib.

            View.AddSubview(TableView);

            var addBtn = new UIButton(new CGRect(20, 100, 100, 44));
            addBtn.SetTitle("Add", UIControlState.Normal);
            addBtn.SetTitleColor(UIColor.Orange, UIControlState.Normal);
            addBtn.TouchUpInside += (s, e) =>
            {
                Source.Add("TestData : " + r.Next(1000, 10000));
            };

            View.AddSubview(addBtn);

            var header = new MJRefreshNormalHeader();
            TableView.SetHeader(header);

            header.RefreshingBlock = async () =>
            {
                Source.Add("TestData : " + r.Next(1000, 10000));
                await Task.Delay(1000);
                header.EndRefreshing();
            };

            header.SetTitle("AA", MJRefreshState.Idle);
            header.SetTitle("BB", MJRefreshState.Pulling);
            header.SetTitle("CC", MJRefreshState.Refreshing);
            header.LastUpdatedTimeLabel.Hidden = true;
        }