void ReleaseDesignerOutlets() { if (clientLogoImage != null) { clientLogoImage.Dispose(); clientLogoImage = null; } if (fingerPrintImage != null) { fingerPrintImage.Dispose(); fingerPrintImage = null; } if (fingerPrintLabelInstruction != null) { fingerPrintLabelInstruction.Dispose(); fingerPrintLabelInstruction = null; } if (fingerPrintLabelTitle != null) { fingerPrintLabelTitle.Dispose(); fingerPrintLabelTitle = null; } if (fingerPrintView != null) { fingerPrintView.Dispose(); fingerPrintView = null; } if (InputContainerView != null) { InputContainerView.Dispose(); InputContainerView = null; } if (passwordTF != null) { passwordTF.Dispose(); passwordTF = null; } if (signINButton != null) { signINButton.Dispose(); signINButton = null; } if (titleLabel != null) { titleLabel.Dispose(); titleLabel = null; } if (userNameTF != null) { userNameTF.Dispose(); userNameTF = null; } }
public override void ViewDidLoad() { base.ViewDidLoad(); // Perform any additional setup after loading the view, typically from a nib. fingerPrintView.Hidden = true; userNameTF.Hidden = true; passwordTF.Hidden = true; loadTheme(); int hexColor = unchecked ((int)0xFFDB642C); activeColor = UIColor.Clear.FromHex(hexColor); // float topOffset = (float)(UIApplication.SharedApplication.StatusBarFrame.Size.Height + NavigationController.NavigationBar.Frame.Size.Height); UIColor floatingLabelColor = UIColor.Gray, floatingLabelActiveColor = activeColor; var userNameField = new FloatLabeledTextField(new CGRect(0, 8, 335, 50)) { Placeholder = "User Name", Font = UIFont.SystemFontOfSize(FieldFontSize), ClearButtonMode = UITextFieldViewMode.WhileEditing, FloatingLabelFont = UIFont.BoldSystemFontOfSize(FieldFloatingLabelFontSize), FloatingLabelTextColor = floatingLabelColor, FloatingLabelActiveTextColor = floatingLabelActiveColor }; InputContainerView.AddSubview(userNameField); var passwordField = new FloatLabeledTextField(new CGRect(0, 66, 335, 50)) { Placeholder = "Password", Font = UIFont.SystemFontOfSize(FieldFontSize), ClearButtonMode = UITextFieldViewMode.WhileEditing, FloatingLabelFont = UIFont.BoldSystemFontOfSize(FieldFloatingLabelFontSize), FloatingLabelTextColor = floatingLabelColor, FloatingLabelActiveTextColor = floatingLabelActiveColor }; InputContainerView.AddSubview(passwordField); userNameField.ClearButtonMode = UITextFieldViewMode.Never; userNameField.AutocorrectionType = UITextAutocorrectionType.No; userNameField.AutocapitalizationType = UITextAutocapitalizationType.None; //userNameField.ReturnKeyType = UIReturnKeyType.Continue; //userNameField.AddConstraint(NSLayoutConstraint ); userNameField.LeftViewMode = UITextFieldViewMode.Always; userNameField.LeftView = new UIImageView(UIImage.FromBundle("cloud"));; passwordField.ClearButtonMode = UITextFieldViewMode.Never; passwordField.SecureTextEntry = true; passwordField.AutocorrectionType = UITextAutocorrectionType.No; passwordField.AutocapitalizationType = UITextAutocapitalizationType.None; var border = new CALayer(); nfloat width = 2; border.BorderColor = floatingLabelColor.CGColor; border.Frame = new CoreGraphics.CGRect(0, userNameField.Frame.Size.Height - width, userNameField.Frame.Size.Width, userNameField.Frame.Size.Height); border.BorderWidth = width; userNameField.Layer.AddSublayer(border); userNameField.Layer.MasksToBounds = true; userNameField.EditingDidBegin += (sender, e) => { Console.WriteLine("NEWuserNameField touched"); border.BorderColor = activeColor.CGColor; }; userNameField.EditingDidEnd += (sender, e) => { Console.WriteLine("NEWuserNameField NOT touched"); border.BorderColor = floatingLabelColor.CGColor; }; var borderP = new CALayer(); // nfloat width = 2; borderP.BorderColor = floatingLabelColor.CGColor; borderP.Frame = new CoreGraphics.CGRect(0, passwordField.Frame.Size.Height - width, passwordField.Frame.Size.Width, passwordField.Frame.Size.Height); borderP.BorderWidth = width; passwordField.Layer.AddSublayer(borderP); passwordField.Layer.MasksToBounds = true; passwordField.EditingDidBegin += (sender, e) => { Console.WriteLine("passwordField touched"); borderP.BorderColor = activeColor.CGColor; }; passwordField.EditingDidEnd += (sender, e) => { Console.WriteLine("passwordField NOTouched"); borderP.BorderColor = floatingLabelColor.CGColor; }; }