From 399fa6e9fb08c154fc30b08ae0c40daab3fd449f Mon Sep 17 00:00:00 2001 From: lss <316519258@qq.com> Date: 星期三, 13 五月 2020 14:53:48 +0800 Subject: [PATCH] 临时备份 --- ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/TextInputControls/TextInputExControl.cs | 22 +++++++++++++++++++--- 1 files changed, 19 insertions(+), 3 deletions(-) diff --git a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/TextInputControls/TextInputExControl.cs b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/TextInputControls/TextInputExControl.cs index 24f7d61..23821be 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/TextInputControls/TextInputExControl.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/TextInputControls/TextInputExControl.cs @@ -16,6 +16,10 @@ /// </summary> public Action FinishInputEvent = null; /// <summary> + /// 鏈�澶ц緭鍏ラ暱搴�(鐩墠鍙拡瀵规寜涓嬪洖杞﹂敭鏃惰繘琛屾娴�,瓒呰繃鏃�,涓嶄細璋冪敤FinishInputEvent) + /// </summary> + public int MaxByte = 0; + /// <summary> /// 鏂囨湰鏄惁涓洪粦鑹插瓧浣� /// </summary> private bool IsTextBlack = false; @@ -33,7 +37,7 @@ public TextInputExControl(int i_Width, int i_Height, bool real = false) { this.InitSize(i_Width, i_Height, real); - this.TextColor = UserCenterColor.Current.TextGrayColor; + this.TextColor = UserCenterColor.Current.TextGrayColor3; this.TextChangeEventHandler += this.TextChangeEvent; this.EditorEnterAction += this.EditorEnterEvent; @@ -47,7 +51,7 @@ public TextInputExControl(int i_Width, bool real = false) { this.InitSize(i_Width, real); - this.TextColor = UserCenterColor.Current.TextGrayColor; + this.TextColor = UserCenterColor.Current.TextGrayColor3; this.TextChangeEventHandler += this.TextChangeEvent; this.EditorEnterAction += this.EditorEnterEvent; @@ -63,7 +67,19 @@ /// <param name="view"></param> private void EditorEnterEvent(View view) { - this.TextColor = UserCenterColor.Current.TextGrayColor; + if (this.MaxByte != 0) + { + if (Encoding.UTF8.GetBytes(this.Text.Trim()).Length > this.MaxByte) + { + //杈撳叆鍐呭杩囬暱,鏈�澶0}瀛楄妭 + string msg = Language.StringByID(R.MyInternationalizationString.uInputContentIsOverLengthMsg); + msg.Replace("{0}", this.MaxByte.ToString()); + var contr = new ShowMsgControl(ShowMsgType.Error, msg); + contr.Show(); + return; + } + } + this.TextColor = UserCenterColor.Current.TextGrayColor3; this.IsTextBlack = false; this.FinishInputEvent?.Invoke(); } -- Gitblit v1.8.0