From 6fa9d69da922c8049f5acfcbb9ce9fd26811024c Mon Sep 17 00:00:00 2001 From: xm <1271024303@qq.com> Date: 星期四, 16 四月 2020 17:10:57 +0800 Subject: [PATCH] 请合并代码 --- ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/BaseCommonControl/Base/TextInputBase.cs | 148 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 148 insertions(+), 0 deletions(-) diff --git a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/BaseCommonControl/Base/TextInputBase.cs b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/BaseCommonControl/Base/TextInputBase.cs new file mode 100755 index 0000000..4c69fe1 --- /dev/null +++ b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/BaseCommonControl/Base/TextInputBase.cs @@ -0,0 +1,148 @@ +锘縰sing System; +using System.Collections.Generic; +using System.Text; + +namespace Shared.Phone.UserCenter +{ + /// <summary> + /// 杈撳叆妗嗘帶浠剁殑鏈�鍒濆師鍨�(涓嶅缓璁慨鏀瑰拰鐩存帴浣跨敤):鏍囧噯瀛椾綋棰滆壊锛屾枃瀛楀悜宸﹂潬榻�,14鍙峰瓧 + /// </summary> + public class TextInputBase : EditText + { + #region 鈻� 鍙橀噺澹版槑___________________________ + + /// <summary> + /// 鑱斿姩搴曠嚎 + /// </summary> + private NormalViewControl btnLineTemp = null; + /// <summary> + /// 鑱斿姩搴曠嚎(鍊艰緭鍏ヤ箣鍚�,绾跨殑棰滆壊浼氬彉) + /// </summary> + public NormalViewControl btnLine + { + set + { + this.btnLineTemp = value; + //鍏夋爣浜嬩欢 + this.FoucsChanged -= this.TxtCode_FoucsChangedEvent; + this.FoucsChanged += this.TxtCode_FoucsChangedEvent; + } + } + + #endregion + + #region 鈻� 鍒濆鍖朹____________________________ + + /// <summary> + /// 杈撳叆妗嗘帶浠剁殑鏈�鍒濆師鍨�(涓嶅缓璁慨鏀瑰拰鐩存帴浣跨敤):鏍囧噯瀛椾綋棰滆壊锛屾枃瀛楀悜宸﹂潬榻�,14鍙峰瓧 + /// </summary> + public TextInputBase() + { + //娴嬭瘯锛屽叏浣撹緭鍏ユ涓�14鍙峰瓧 + this.TextSize = 14; + + this.PlaceholderTextColor = UserCenterColor.Current.TextTipColor; + this.TextColor = UserCenterColor.Current.TextColor1; + this.TextAlignment = TextAlignment.CenterLeft; + } + + /// <summary> + /// 鍒濆鍖栨帶浠跺ぇ灏�(涓嶄互骞冲潎鍊艰繘琛岀湡瀹炴暟鍊艰绠�) + /// </summary> + /// <param name="i_Width">瀹藉害</param> + /// <param name="i_Height">楂樺害</param> + /// <param name="real">鏄惁璁$畻鐪熷疄鍊�</param> + public void InitSize(int i_Width, int i_Height, bool real = true) + { + if (real == true) + { + i_Width = Application.GetRealWidth(i_Width); + i_Height = Application.GetRealHeight(i_Height); + } + + this.Height = i_Height; + this.Width = i_Width; + } + + /// <summary> + /// 鍒濆鍖栨帶浠跺ぇ灏�(涓嶄互骞冲潎鍊艰繘琛岀湡瀹炴暟鍊艰绠�) + /// </summary> + /// <param name="i_Width">瀹藉害</param> + /// <param name="real">鏄惁璁$畻鐪熷疄鍊�</param> + public void InitSize(int i_Width, bool real = true) + { + if (real == true) + { + i_Width = Application.GetRealWidth(i_Width); + } + + this.Height = ControlCommonResourse.NormalControlHeight; + this.Width = i_Width; + } + + /// <summary> + /// 鍒濆鍖栨帶浠跺ぇ灏�(浠ュ钩鍧囧�艰繘琛岀湡瀹炴暟鍊艰绠�) + /// </summary> + /// <param name="i_Width">瀹藉害</param> + /// <param name="i_Height">楂樺害</param> + /// <param name="real">鏄惁璁$畻鐪熷疄鍊�</param> + public void InitAvgSize(int i_Width, int i_Height, bool real = true) + { + if (real == true) + { + i_Width = Application.GetMinRealAverage(i_Width); + i_Height = Application.GetMinRealAverage(i_Height); + } + + this.Height = i_Height; + this.Width = i_Width; + } + + #endregion + + #region 鈻� 浜嬩欢_______________________________ + + /// <summary> + /// 鐒︾偣鍙樻洿浜嬩欢 + /// </summary> + /// <param name="sender"></param> + /// <param name="e"></param> + private void TxtCode_FoucsChangedEvent(object sender, FocusEventArgs e) + { + if (e.Focus == false) + { + if (btnLineTemp != null) + { + btnLineTemp.BackgroundColor = UserCenterColor.Current.ButtomLine; + } + } + else + { + if (btnLineTemp != null) + { + btnLineTemp.BackgroundColor = UserCenterColor.Current.TextFrameSelectColor; + } + } + } + + #endregion + + #region 鈻� 涓�鑸柟娉昣__________________________ + + /// <summary> + /// Y杞撮噸缃�(鐪熷疄鏁板��,娌℃湁鐖跺鍣ㄦ棤鏁�) + /// </summary> + /// <param name="alignment">涓婁笅瀵归綈鏂瑰紡</param> + /// <param name="Space">涓婁笅涓ら儴鍒嗙殑闂磋窛</param> + public void ReSetYaxis(UViewAlignment alignment, int Space = 0) + { + if (this.Parent == null) + { + return; + } + //Y杞撮噸缃� + this.Y = HdlControlLogic.Current.GetControlChidrenYaxis(this.Parent.Height, this.Height, alignment, Space); + } + #endregion + } +} -- Gitblit v1.8.0