Пример #1
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            // Setup the item list we will display
            // your carousel should always be driven by an array/list of
            // data of some kind - don't store data in your item views
            // or the recycling mechanism will destroy your data once
            // your item views move off-screen
            items = Enumerable.Range(1, 100).ToList(); // Prettier than for (nint i = 0; i < 100; i++)

            // Setup Background image
            var imgView = new UIImageView(UIImage.FromBundle("background"))
            {
                ContentMode      = UIViewContentMode.ScaleToFill,
                AutoresizingMask = UIViewAutoresizing.All,
                Frame            = View.Bounds
            };

            View.AddSubview(imgView);

            // Setup CarouselView view
            carousel = new CarouselView(View.Bounds)
            {
                DataSource = new ButtonsDataSource(this),
                Delegate   = new CarouselViewDelegate()
            };
            carousel.CarouselType = CarouselType.CoverFlow2;
            carousel.ConfigureView();

            View.AddSubview(carousel);
        }
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            // Setup the item list we will display
            // your carousel should always be driven by an array/list of
            // data of some kind - don't store data in your item views
            // or the recycling mechanism will destroy your data once
            // your item views move off-screen
            items = new List <int>();

            // Setup Background image
            var imgView = new UIImageView(UIImage.FromBundle("background"))
            {
                ContentMode      = UIViewContentMode.ScaleToFill,
                AutoresizingMask = UIViewAutoresizing.All,
                Frame            = View.Bounds
            };

            View.AddSubview(imgView);

            // Setup CarouselView view
            carousel              = new CarouselView(View.Bounds);
            carousel.DataSource   = new ZeroItemLinearDataSource(this);
            carousel.Delegate     = new ZeroItemLinearDelegate(this);
            carousel.CarouselType = CarouselType.Linear;
            carousel.ConfigureView();

            View.AddSubview(carousel);
        }
Пример #3
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            // Setup Background image
            var imgView = new UIImageView(UIImage.FromBundle("background"))
            {
                ContentMode      = UIViewContentMode.ScaleToFill,
                AutoresizingMask = UIViewAutoresizing.All,
                Frame            = View.Bounds
            };

            View.AddSubview(imgView);

            // Setup CarouselView view
            Carousel = new CarouselView(View.Bounds)
            {
                DataSource = new ControlsDataSource(this),
                Delegate   = new CarouselViewDelegate()
            };
            Carousel.CarouselType = CarouselType.CoverFlow2;
            Carousel.ConfigureView();

            View.AddSubview(Carousel);

            // Setup info label
            Label = new UILabel(new RectangleF(20, 362, 280, 21))
            {
                BackgroundColor = UIColor.Clear,
                Text            = string.Empty,
                TextAlignment   = UITextAlignment.Center
            };

            View.AddSubview(Label);
        }
Пример #4
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            items = Enumerable.Range(1, 100).ToList();
            BigTed.BTProgressHUD.Show("Loading Image");
            View.DownloadImageAsync(item.images [0]).ContinueWith((task) => InvokeOnMainThread(() => {
                var imgView = new UIImageView(task.Result)
                {
                    ContentMode      = UIViewContentMode.ScaleToFill,
                    AutoresizingMask = UIViewAutoresizing.All,
                    Frame            = View.Bounds
                };
                View.AddSubview(imgView);

                carousel              = new CarouselView(new RectangleF(0, 400, View.Bounds.Width, 50));
                carousel.DataSource   = new LinearDataSource(item);
                carousel.Delegate     = new LinearDelegate();
                carousel.CarouselType = CarouselType.Linear;
                carousel.ConfigureView();
                View.AddSubview(carousel);
                carousel.Autoscroll = 1.0f;
                BigTed.BTProgressHUD.Dismiss();
            }
                                                                                               ));
        }
		async void GetData ()
		{
			//source.Products

			List<Product> PP = await WebService.Shared.GetProducts ();
			//Kicking off a task no need to await
			#pragma warning disable 4014
			WebService.Shared.PreloadImages (320 * UIScreen.MainScreen.Scale);
			#pragma warning restore 4014

			carousel = new CarouselView(new RectangleF(0,64,  View.Bounds.Width, View.Bounds.Height - 94));
			carousel.BackgroundColor = UIColor.White;
			carousel.DataSource = new LinearDataSource(this, PP);
			carousel.Delegate = new LinearDelegate(this, 
				PP,  (products => { ProductTapped(products); }));
			carousel.CarouselType = CarouselType.Rotary;
			carousel.ConfigureView();
			View.AddSubview(carousel);

		}
Пример #6
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad ();

            InitActiveField ();

            items = GetActiveGalleryItems ();

            Console.WriteLine (items.Count);

            var imgView = new UIImageView (BlueSea.MakeBlueSea ()) {
                ContentMode = UIViewContentMode.ScaleToFill,
                AutoresizingMask = UIViewAutoresizing.All,
                Frame = View.Bounds
            };
            View.AddSubview (imgView);
            View.SendSubviewToBack (imgView);

            carousel = new CarouselView (UIScreen.MainScreen.Bounds);
            //carousel. = images.Count;
            carousel.DataSource = new GalleryDataSource (this);
            gd = new GalleryDelegate (this);
            carousel.Delegate = gd;
            carousel.CarouselType = CarouselType.CoverFlow;
            carousel.ConfigureView ();
            View.AddSubview (carousel);

            //
            //			tap = new UITapGestureRecognizer (Tapped);
            //			tap.NumberOfTapsRequired = 1;
            //			carousel.AddGestureRecognizer (tap);

            View.AddSubview (carousel);
            //CreateAddBarButton ();
            //CreateDeleteBarButton ();

            //carousel.CurrentItemIndex

            //InitSateliteMenu ();

            menu = new IndexerSateliteMenu ("Gallery", this);
            View.Add (menu.View);

            CreateOptions ();

            View.BringSubviewToFront (ActiveText);
        }
Пример #7
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad ();

            var imgView = new UIImageView(BlueSea.MakeBlueSea()){
                ContentMode = UIViewContentMode.ScaleToFill,
                AutoresizingMask = UIViewAutoresizing.All,
                Frame = View.Bounds
            };

            View.Add (imgView);
            View.SendSubviewToBack (imgView);

            Photos = AppDelegate.dao.GetInsurancePhotosByTypeAndID (isLargeObject, currentID);

            carousel = new CarouselView(View.Bounds);
            carousel.DataSource = new InsurancePhotoDataSource(this);
            carousel.Delegate = new InsurancePhotoDelegate(this);
            carousel.CarouselType = CarouselType.CoverFlow;
            carousel.ConfigureView();
            View.AddSubview(carousel);

            View.AddSubview (carousel);
            CreateAddBarButton ();
            CreateDeleteBarButton ();

            //carousel.CurrentItemIndex
        }