Exemplo n.º 1
0
        /// <summary>
        /// Initialize the view with the frame
        /// </summary>
        /// <param name='frame'>
        /// The frame to initialize the view in
        /// </param>
        /// <param name='showNextPagePreview'>
        /// Allow space to preview the next page
        /// </param>
        private void Initialize(RectangleF frame, bool showNextPagePreview)
        {
            var newFrame = new RectangleF(0, 0, frame.Size.Width, frame.Size.Height);

            this.backgroundView = new UIView(newFrame);
            this.backgroundView.ClipsToBounds    = true;
            this.backgroundView.AutoresizingMask = UIViewAutoresizing.FlexibleWidth;

            var pageFrame = newFrame;

            if (showNextPagePreview)
            {
                pageFrame.Width -= 30;
            }

            this.pageScrollView = new UIScrollView(pageFrame);
            this.pageScrollView.PagingEnabled = true;
            this.pageScrollView.ShowsVerticalScrollIndicator   = false;
            this.pageScrollView.ShowsHorizontalScrollIndicator = true;
            this.pageScrollView.ContentSize = new SizeF(pageFrame.Size.Width * 0, pageFrame.Size.Height);
            this.pageScrollView.ShowsHorizontalScrollIndicator = false;

            this.pageScrollView.ClipsToBounds = false;
            this.pageScrollView.Delegate      = new ScrollDelegate(this);

            this.backgroundView.AddSubview(this.pageScrollView);
            this.AddSubview(this.backgroundView);

            if (this.pageControl != null)
            {
                this.BringSubviewToFront(this.pageControl);
            }
        }
Exemplo n.º 2
0
 /// <summary>
 /// Initialize the view with the frame
 /// </summary>
 /// <param name='frame'>
 /// The frame to initialize the view in
 /// </param>
 /// <param name='showNextPagePreview'>
 /// Allow space to preview the next page
 /// </param>
 private void Initialize(RectangleF frame, bool showNextPagePreview)
 {
     var newFrame = new RectangleF(0, 0, frame.Size.Width, frame.Size.Height);
     
     this.backgroundView = new UIView(newFrame);
     this.backgroundView.ClipsToBounds = true;
     this.backgroundView.AutoresizingMask = UIViewAutoresizing.FlexibleWidth;
     
     var pageFrame = newFrame;
     if (showNextPagePreview)
     {
         pageFrame.Width -= 30;
     }
     
     this.pageScrollView = new UIScrollView(pageFrame);
     this.pageScrollView.PagingEnabled = true;
     this.pageScrollView.ShowsVerticalScrollIndicator = false;
     this.pageScrollView.ShowsHorizontalScrollIndicator = true;
     this.pageScrollView.ContentSize = new SizeF(pageFrame.Size.Width * 0, pageFrame.Size.Height);
     this.pageScrollView.ShowsHorizontalScrollIndicator = false;
              
     this.pageScrollView.ClipsToBounds = false;
     this.pageScrollView.Delegate = new ScrollDelegate(this);
     
     this.backgroundView.AddSubview(this.pageScrollView);
     this.AddSubview(this.backgroundView);
     
     if (this.pageControl != null)
     {
         this.BringSubviewToFront(this.pageControl);
     }
 }