| | |
| | | #region ■ 添加列表消息显示控件_______________
|
| | |
|
| | | /// <summary>
|
| | | /// 添加列表消息显示控件,返回的是最后一个控件的底部坐标
|
| | | /// 添加列表消息显示控件,返回的是最后一个控件的底部坐标(没看懂这个函数前,请勿使用)
|
| | | /// </summary>
|
| | | /// <param name="frameTable">桌布容器控件</param>
|
| | | /// <param name="i_msg">显示的消息(换行请使用【{0}】进行分割)</param>
|
| | |
| | | /// <para>注:除了新建这个函数的开发者以外,都不建议把这个值不设置为true</para>
|
| | | /// <para>说明:以最长的控件的X轴为基准,所有控件的X轴都变成一致</para>
|
| | | /// </param>
|
| | | /// <param name="i_width">文本宽度,真实值,当为-1时,内部自动计算</param>
|
| | | /// <returns></returns>
|
| | | public int AddListMsgControls(FrameLayout frameTable, string i_msg, int i_fontSize, uint i_fontColor, int i_height,
|
| | | int i_yy, TextAlignment alignment = TextAlignment.Center, bool special = false)
|
| | | int i_yy, TextAlignment alignment = TextAlignment.Center, bool special = false, int i_width = -1)
|
| | | {
|
| | | var listMsg = i_msg.Split(new string[] { "{0}" }, StringSplitOptions.RemoveEmptyEntries);
|
| | | int defultWidth = this.bodyFrameLayout.Width - HdlControlResourse.XXLeft * 2;
|
| | | int defultWidth = 0;
|
| | | if (this.bodyFrameLayout != null)
|
| | | {
|
| | | defultWidth = i_width == -1 ? this.bodyFrameLayout.Width - HdlControlResourse.XXLeft * 2 : i_width;
|
| | | }
|
| | | else
|
| | | {
|
| | | defultWidth = i_width == -1 ? frameTable.Width - HdlControlResourse.XXLeft * 2 : i_width;
|
| | | }
|
| | |
|
| | | //如果只是一行的时候
|
| | | bool isMoreLine = false;
|
| | | if (listMsg.Length == 1)
|
| | | {
|
| | | var btnTemp = new ButtonCtrBase();
|
| | | btnTemp.TextSize = i_fontSize;
|
| | | btnTemp.Text = i_msg;
|
| | | int rowCount = btnTemp.GetRealRowCountByText(defultWidth);
|
| | | //它的高度由行数决定(理论上应该都是1行,这里做特殊处理而已)
|
| | | if (rowCount > 1)
|
| | | {
|
| | | i_height = i_height * rowCount;
|
| | | isMoreLine = true;
|
| | | }
|
| | | }
|
| | |
|
| | | var listContr = new List<NormalViewControl>();
|
| | | int minXX = 10086;//控件集合最小的X轴
|
| | |
| | | btnMsg.TextColor = i_fontColor;
|
| | | btnMsg.TextSize = i_fontSize;
|
| | | btnMsg.Text = strMsg;
|
| | | if (isMoreLine == true)
|
| | | {
|
| | | //可以换行
|
| | | btnMsg.IsMoreLines = isMoreLine;
|
| | | }
|
| | |
|
| | | //特殊处理
|
| | | if (special == true && alignment == TextAlignment.Center)
|