Ejemplo n.º 1
0
        private void SetUpTextFields()
        {
            // Assign delegates for UITextFields
            UserTextField.ShouldReturn     += TextFieldShouldReturn;
            PasswordTextField.ShouldReturn += TextFieldShouldReturn;

            PasswordTextField.LayoutIfNeeded();

            // Config placeholder with color for user TextField
            var placeHolderUser = new NSAttributedString("Ingrese su usuario", font: UIFont.FromName("System-Light", 17.0f), foregroundColor: UIColor.White);

            UserTextField.AttributedPlaceholder = placeHolderUser;

            // Config placeholder with color for password TextField
            var placeHolderPassword = new NSAttributedString("Ingrese su contraseña", font: UIFont.FromName("System-Light", 17.0f), foregroundColor: UIColor.White);

            PasswordTextField.AttributedPlaceholder = placeHolderPassword;

            VersionTextField.Text = "v" + NSBundle.MainBundle.InfoDictionary["CFBundleShortVersionString"];

            // Add tap gesture recognizer to dismiss the keyboard
            View.AddGestureRecognizer(new UITapGestureRecognizer(() => this.DismissKeyboard()));
        }