コード例 #1
0
        public override void ViewDidLayoutSubviews()
        {
            this.setupLayout();

            //Console.WriteLine("ViewDidLayoutSubviews 1");
            if (this.View.Bounds == CGRect.Empty)
            {
                return;
            }

            var orientationSavvyBounds = new CGRect(0, 0, this.View.Bounds.Width, this.heightForOrientation(this.InterfaceOrientation, withTopBanner: false));


            //Console.WriteLine("ViewDidLayoutSubviews 2");
            if (lastLayoutBounds != null && lastLayoutBounds == orientationSavvyBounds)
            {
                // do nothing;
            }
            else
            {
                //Console.WriteLine("ViewDidLayoutSubviews 2a");
                var uppercase          = this.shiftState.uppercase();
                var characterUppercase = uppercase;// (NSUserDefaults.StandardUserDefaults.BoolForKey(kSmallLowercase) ? uppercase : true);


                //Console.WriteLine("ViewDidLayoutSubviews 2b");
                this.forwardingView.Frame = orientationSavvyBounds;

                //Console.WriteLine("ViewDidLayoutSubviews 2c");
                this.layout?.layoutKeys(this.currentMode, uppercase: uppercase, characterUppercase: characterUppercase, shiftState: this.shiftState);
                this.lastLayoutBounds = orientationSavvyBounds;

                //Console.WriteLine("ViewDidLayoutSubviews 2d");
                this.setupKeys();
            }

            if (bannerView != null)
            {
                this.bannerView.Frame  = new CGRect(0, 0, this.View.Bounds.Width, Metrics.metric("topBanner"));
                this.toolbarView.Frame = new CGRect(0, 0, this.View.Bounds.Width, Metrics.metric("topBanner"));
                //this.bannerView.BackgroundColor = UIColor.Red;
            }

            if (spacerView != null)
            {
                this.spacerView.Frame = new CGRect(0, Metrics.metric("topBanner"), this.View.Bounds.Width, Metrics.metric("topSpacer"));
                //this.spacerView.BackgroundColor = UIColor.Yellow;
            }

            var newOrigin = new CGPoint(0, this.View.Bounds.Height - this.forwardingView.Bounds.Height);
            var fr        = this.forwardingView.Frame;

            fr.Location = newOrigin;
            this.forwardingView.Frame = fr;
        }
コード例 #2
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            this.setupKludge();

            var aBanner = this.createBanner();

            if (aBanner != null)
            {
                toolbarView = new UIToolbar(new CGRect(0.0f, 0.0f, this.View.Frame.Size.Width, Metrics.metric("topBanner")));
                cleanToolbar();

                aBanner.Add(toolbarView);
                aBanner.Hidden = true;
                this.View.InsertSubviewBelow(aBanner, siblingSubview: this.forwardingView);
                this.bannerView = aBanner;
            }

            var aSpacer = this.createSpacer();

            if (aSpacer != null)
            {
                aSpacer.Hidden = true;
                this.View.InsertSubviewBelow(aSpacer, siblingSubview: this.forwardingView);
                this.spacerView = aSpacer;
            }
        }