| | |
| | |
|
| | | #endregion
|
| | |
|
| | | #region ■ 添加列表消息显示控件_______________
|
| | |
|
| | | /// <summary>
|
| | | /// 添加列表消息显示控件,返回的是最后一个控件的底部坐标
|
| | | /// </summary>
|
| | | /// <param name="frameTable">桌布容器控件</param>
|
| | | /// <param name="i_msg">显示的消息(换行请使用【{0}】进行分割)</param>
|
| | | /// <param name="i_fontSize">字体大小</param>
|
| | | /// <param name="i_fontColor">字体颜色</param>
|
| | | /// <param name="i_height">控件高度(真实值)</param>
|
| | | /// <param name="i_yy">Y轴初始坐标(真实值)</param>
|
| | | /// <param name="alignment">文字对齐方式</param>
|
| | | /// <param name="special">
|
| | | /// <para>注:除了新建这个函数的开发者以外,都不建议把这个值不设置为true</para>
|
| | | /// <para>说明:以最长的控件的X轴为基准,所有控件的X轴都变成一致</para>
|
| | | /// </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)
|
| | | {
|
| | | var listMsg = i_msg.Split(new string[] { "{0}" }, StringSplitOptions.RemoveEmptyEntries);
|
| | | int defultWidth = this.bodyFrameLayout.Width - HdlControlResourse.XXLeft * 2;
|
| | |
|
| | | var listContr = new List<NormalViewControl>();
|
| | | int minXX = 10086;//控件集合最小的X轴
|
| | | foreach (var strMsg in listMsg)
|
| | | {
|
| | | //消息显示控件
|
| | | var btnMsg = new NormalViewControl(defultWidth, i_height, false);
|
| | | btnMsg.Y = i_yy;
|
| | | btnMsg.Gravity = Gravity.CenterHorizontal;
|
| | | btnMsg.TextAlignment = alignment;
|
| | | btnMsg.TextColor = i_fontColor;
|
| | | btnMsg.TextSize = i_fontSize;
|
| | | btnMsg.Text = strMsg;
|
| | |
|
| | | //特殊处理
|
| | | if (special == true && alignment == TextAlignment.Center)
|
| | | {
|
| | | //设置它的真实宽度(对special变量有用)
|
| | | int realWidth = btnMsg.GetRealWidthByText();
|
| | | btnMsg.Width = realWidth > defultWidth ? defultWidth : realWidth;
|
| | | }
|
| | | frameTable.AddChidren(btnMsg);
|
| | |
|
| | | //收集控件
|
| | | listContr.Add(btnMsg);
|
| | |
|
| | | //记录控件集合X轴最小的值
|
| | | if (btnMsg.X < minXX) { minXX = btnMsg.X; }
|
| | |
|
| | | //两行之间的间距为4
|
| | | i_yy = btnMsg.Bottom + Application.GetRealHeight(4);
|
| | | }
|
| | | //特殊处理
|
| | | if (special == true && alignment == TextAlignment.Center)
|
| | | {
|
| | | foreach (var contr in listContr)
|
| | | {
|
| | | //以最长的控件的X轴为基准,所有控件的X轴都变成一致
|
| | | contr.X = minXX;
|
| | | }
|
| | | }
|
| | |
|
| | | return i_yy - Application.GetRealHeight(4);
|
| | | }
|
| | |
|
| | | #endregion
|
| | |
|
| | | #region ■ 添加底部点击按钮控件_______________
|
| | |
|
| | | /// <summary>
|
| | | /// 添加底部点击按钮控件
|
| | | /// </summary>
|
| | | /// <param name="i_text">显示的文本</param>
|
| | | /// <returns></returns>
|
| | | public BottomClickButton AddBottomClickButton(string i_text)
|
| | | {
|
| | | //容器控件
|
| | | var frameBack = new FrameLayout();
|
| | | frameBack.Height = Application.GetRealHeight(76);
|
| | | frameBack.Gravity = Gravity.BottomCenter;
|
| | | bodyFrameLayout.AddChidren(frameBack);
|
| | | //然后在顶部添加一个有边框的东西
|
| | | var frameLine = new FrameLayout();
|
| | | frameLine.Height = Application.GetRealHeight(50);
|
| | | frameLine.BorderWidth = 1;
|
| | | frameLine.BackgroundColor = UI.CSS.CSS_Color.MainBackgroundColor;
|
| | | frameLine.BorderColor = UI.CSS.CSS_Color.DividingLineColor;
|
| | | frameLine.SetCornerWithSameRadius(Application.GetRealHeight(24), HDLUtils.RectCornerTopLeft | HDLUtils.RectCornerTopRight);
|
| | | frameBack.AddChidren(frameLine);
|
| | | //最后再整个白色的东西遮住它的下部
|
| | | var frameWite = new FrameLayout();
|
| | | frameWite.Height = frameBack.Height - Application.GetRealHeight(24 - 10);//需要超过它
|
| | | frameWite.Width = frameBack.Width + Application.GetRealWidth(6);
|
| | | frameWite.X = -Application.GetRealWidth(3);
|
| | | frameWite.Y = Application.GetRealHeight(24);
|
| | | frameWite.BackgroundColor = UI.CSS.CSS_Color.MainBackgroundColor;
|
| | | frameBack.AddChidren(frameWite);
|
| | |
|
| | | //按钮
|
| | | var btnOk = new BottomClickButton(220);
|
| | | btnOk.Gravity = Gravity.Center;
|
| | | btnOk.Text = i_text;
|
| | | frameBack.AddChidren(btnOk);
|
| | |
|
| | | return btnOk;
|
| | | }
|
| | |
|
| | | #endregion
|
| | |
|
| | | #region ■ 一般的方法_________________________ |
| | |
|
| | | /// <summary> |