Ejemplo n.º 1
0
        public override void ViewDidLayoutSubviews()
        {
            base.ViewDidLayoutSubviews();

            HeaderView.Frame = new CGRect(View.Frame.Left, View.Frame.Top, View.Frame.Width, StyledTextField.StyledFieldHeight);

            ScrollView.Frame = new CGRect(View.Frame.Left, HeaderView.Frame.Bottom, View.Frame.Width, View.Frame.Height - HeaderView.Frame.Height);

            UserNameText.SetFrame(new CGRect(-10, View.Frame.Height * .05f, View.Frame.Width + 20, StyledTextField.StyledFieldHeight));
            PasswordText.SetFrame(new CGRect(-10, UserNameText.Background.Frame.Bottom, View.Frame.Width + 20, StyledTextField.StyledFieldHeight));
            ConfirmPasswordText.SetFrame(new CGRect(-10, PasswordText.Background.Frame.Bottom, View.Frame.Width + 20, StyledTextField.StyledFieldHeight));

            NickNameText.SetFrame(new CGRect(-10, ConfirmPasswordText.Background.Frame.Bottom + 40, View.Frame.Width + 20, StyledTextField.StyledFieldHeight));
            LastNameText.SetFrame(new CGRect(-10, NickNameText.Background.Frame.Bottom, View.Frame.Width + 20, StyledTextField.StyledFieldHeight));

            EmailText.SetFrame(new CGRect(-10, LastNameText.Background.Frame.Bottom + 40, View.Frame.Width + 20, StyledTextField.StyledFieldHeight));
            CellPhoneText.SetFrame(new CGRect(-10, EmailText.Background.Frame.Bottom, View.Frame.Width + 20, StyledTextField.StyledFieldHeight));

            DoneButton.Frame   = new CGRect(View.Frame.Left + 10, CellPhoneText.Background.Frame.Bottom + 20, View.Bounds.Width - 20, ControlStyling.ButtonHeight);
            CancelButton.Frame = new CGRect((View.Frame.Width - ControlStyling.ButtonWidth) / 2, DoneButton.Frame.Bottom + 20, ControlStyling.ButtonWidth, ControlStyling.ButtonHeight);

            // for the scroll size, if the content is larger than the screen, we'll take the bottom
            // of the content plus some padding. Otherwise, we'll just use the window height plus a tiny bit so there's
            // a subtle scroll effect
            nfloat controlBottom = CancelButton.Frame.Bottom + (View.Bounds.Height * .25f);

            ScrollView.ContentSize = new CGSize(0, (nfloat)Math.Max(controlBottom, View.Bounds.Height * 1.05f));

            // setup the header shadow
            UIBezierPath shadowPath = UIBezierPath.FromRect(HeaderView.Bounds);

            HeaderView.Layer.MasksToBounds = false;
            HeaderView.Layer.ShadowColor   = UIColor.Black.CGColor;
            HeaderView.Layer.ShadowOffset  = new CGSize(0.0f, .0f);
            HeaderView.Layer.ShadowOpacity = .23f;
            HeaderView.Layer.ShadowPath    = shadowPath.CGPath;

            if (LogoView != null)
            {
                LogoView.Layer.Position = new CoreGraphics.CGPoint((HeaderView.Bounds.Width - LogoView.Bounds.Width) / 2, 0);
            }

            ResultView.SetBounds(View.Frame.ToRectF( ));
            BlockerView.SetBounds(View.Frame.ToRectF( ));
        }