| | |
| | | set |
| | | { |
| | | iosUITextView.SecureTextEntry = value; |
| | | |
| | | // if (value) |
| | | // { |
| | | // ResetTextContentType(); |
| | | // } |
| | | } |
| | | } |
| | | |
| | | |
| | | /// <summary> |
| | | /// 暂时解决iOS13 以上默认提示自动生成强密码,不是最优方案 |
| | | /// </summary> |
| | | public void ResetTextContentType() |
| | | { |
| | | if (UIDevice.CurrentDevice.CheckSystemVersion(12, 0)) |
| | | { |
| | | |
| | | iosUITextView.SetTextContentType(UITextContentType.Password); |
| | | |
| | | //HDLUtils.WriteLine(" GetTextContentType: " + iosUITextView.GetTextContentType().ToString()); |
| | | //if (iosUITextView.GetTextContentType() == UITextContentType.NewPassword) |
| | | //{ |
| | | // iosUITextView.SetTextContentType(UITextContentType.Password); |
| | | //} |
| | | } |
| | | } |
| | | |
| | | |
| | | bool isNumberKeyboardType = false; |
| | | //设置键盘类型 |
| | | public bool IsNumberKeyboardType |
| | | { |
| | | get |
| | | { |
| | | return isNumberKeyboardType; |
| | | } |
| | | set |
| | | { |
| | | isNumberKeyboardType = value; |
| | | if (value) |
| | | { |
| | | iosUITextView.KeyboardType = UIKeyboardType.NumberPad; |
| | | } |
| | | else |
| | | { |
| | | iosUITextView.KeyboardType = UIKeyboardType.Default; |
| | | } |
| | | |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | public static EditText Instance; |
| | | /// <summary> |
| | | /// 构造函数 |
| | |
| | | public EditText() |
| | | { |
| | | iosUITextView = new MyEditText(this) { }; |
| | | ResetTextContentType(); |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | base.MovedToSuperview(); |
| | | if (Superview == null) |
| | | { |
| | | System.Console.WriteLine("从父控件中移除"); |
| | | //Shared.HDLUtils.WriteLine("从父控件中移除"); |
| | | } |
| | | else { |
| | | System.Console.WriteLine("添加到父控件"); |
| | | //Shared.HDLUtils.WriteLine("添加到父控件"); |
| | | } |
| | | } |
| | | |