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

            _database = AppDelegate.SessionDatabase;
            _sessions = _database.GetSessions(_date).ToList();

            // no XIB !
            tableView = new UITableView()
            {
                Delegate = new TableViewDelegate(this, _date, _sessions),
                DataSource = new TableViewDataSource(this, _date, _sessions),
                AutoresizingMask = UIViewAutoresizing.FlexibleHeight|
                                   UIViewAutoresizing.FlexibleWidth,
                BackgroundColor = UIColor.White,
            };

            // Set the table view to fit the width of the app.
            tableView.SizeToFit();

            // Reposition and resize the receiver
            tableView.Frame = new RectangleF (0, 0, this.View.Frame.Width, this.View.Frame.Height);

            // Add the table view as a subview
            this.View.AddSubview(tableView);
        }
        /// <summary>
        /// 
        /// </summary>
        /// <remarks>
        /// Background image idea from 
        /// http://mikebluestein.wordpress.com/2009/10/05/setting-an-image-background-on-a-uitableview-using-monotouch/
        /// </remarks>
        public override void ViewDidLoad()
        {
            base.ViewDidLoad ();

            _database = AppDelegate.SessionDatabase;
            _speakers = _database.GetSpeakers().ToList();

            UIImageView imageView = new UIImageView(UIImage.FromFile("BackgroundMonospace.png"));
            imageView.Frame = new RectangleF (0, 0, this.View.Frame.Width, this.View.Frame.Height);
            imageView.UserInteractionEnabled = true;

            // no XIB !
            tableView = new UITableView()
            {
                Delegate = new TableViewDelegate(this, _speakers),
                DataSource = new TableViewDataSource(_speakers),
                AutoresizingMask = UIViewAutoresizing.FlexibleHeight|
                                   UIViewAutoresizing.FlexibleWidth,
                BackgroundColor = UIColor.Clear,
                Frame = new RectangleF (0, 0, this.View.Frame.Width, this.View.Frame.Height-100)
            };

            imageView.AddSubview(tableView);
            this.View.AddSubview(imageView);
        }
Beispiel #3
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad ();

            _database = AppDelegate.SessionDatabase;
            _dates = _database.GetDates().ToList();

            UIImageView imageView = new UIImageView(UIImage.FromFile("BackgroundMonospace.png"));
            imageView.Frame = new RectangleF (0, 0, this.View.Frame.Width, this.View.Frame.Height);
            imageView.UserInteractionEnabled = true;

            // no XIB !
            tableView = new UITableView()
            {
                Delegate = new TableViewDelegate(this, _dates),
                DataSource = new TableViewDataSource(this, _dates),
                AutoresizingMask = UIViewAutoresizing.FlexibleHeight|
                                   UIViewAutoresizing.FlexibleWidth,
                BackgroundColor = UIColor.Clear,
                Frame = new RectangleF (0, 0, this.View.Frame.Width, this.View.Frame.Height),
            };
            // Set the table view to fit the width of the app.
            //tableView.SizeToFit();
            // Reposition and resize the receiver
            //tableView.Frame = new RectangleF (0, 0, this.View.Frame.Width, this.View.Frame.Height);
            // Add the table view as a subview
            //this.View.AddSubview(tableView);

            imageView.AddSubview(tableView);
            this.View.AddSubview(imageView);
        }
Beispiel #4
0
        /// <summary>
        /// Create the TabBarController which will drive the different views in this app.
        /// IT will create the 'sub' NavigationControllers necessary
        /// </summary>
        public override bool FinishedLaunching(UIApplication app, NSDictionary options)
        {
            SessionDatabase = new Database ("Conference.db");

            // Create the tab
            tabBarController = new Monospace2.TabBarController ();

            // Create the main window and add the navigation controller as a subview
            window = new UIWindow (UIScreen.MainScreen.Bounds);
            window.AddSubview(tabBarController.View);
            window.MakeKeyAndVisible ();
            return true;
        }