| | |
| | | /// </summary>
|
| | | private void InitMiddleFrame(string i_file)
|
| | | {
|
| | | if (i_file == string.Empty) { return; }
|
| | |
|
| | | if (i_file.EndsWith(".png") == true || i_file.EndsWith(".jpg") == true || i_file.EndsWith(".JPG") == true)
|
| | | {
|
| | | var btnPic = new ImageView();
|
| | |
| | | else
|
| | | {
|
| | | string textValue = System.Text.Encoding.UTF8.GetString(Shared.IO.FileUtils.ReadFile(i_file)).Trim();
|
| | | textValue = textValue.Replace(",", "\r\n");
|
| | | if (textValue.StartsWith("{") == true)
|
| | | {
|
| | | textValue = "{\r\n" + textValue.Substring(1);
|
| | | }
|
| | | if (textValue.EndsWith("}") == true)
|
| | | {
|
| | | textValue = textValue.Substring(0, textValue.Length - 1) + "\r\n}";
|
| | | }
|
| | |
|
| | | var btnText = new EditTextView();
|
| | | btnText.Width = bodyFrameLayout.Width;
|
| | | btnText.Height = bodyFrameLayout.Height;
|
| | | btnText.TextAlignment = TextAlignment.TopLeft;
|
| | | btnText.TextColor = UserCenterColor.Current.TextColor1;
|
| | | btnText.Text = textValue;
|
| | | bodyFrameLayout.AddChidren(btnText);
|
| | | this.SetTextContent(textValue);
|
| | | }
|
| | | }
|
| | |
|
| | | /// <summary>
|
| | | /// 自定义设置显示的文本
|
| | | /// </summary>
|
| | | /// <param name="i_text"></param>
|
| | | public void SetTextContent(string textValue)
|
| | | {
|
| | | textValue = textValue.Replace(",", "\r\n");
|
| | | if (textValue.StartsWith("{") == true)
|
| | | {
|
| | | textValue = "{\r\n" + textValue.Substring(1);
|
| | | }
|
| | | if (textValue.EndsWith("}") == true)
|
| | | {
|
| | | textValue = textValue.Substring(0, textValue.Length - 1) + "\r\n}";
|
| | | }
|
| | |
|
| | | var btnText = new EditTextView();
|
| | | btnText.Width = bodyFrameLayout.Width;
|
| | | btnText.Height = bodyFrameLayout.Height;
|
| | | btnText.TextAlignment = TextAlignment.TopLeft;
|
| | | btnText.TextColor = UserCenterColor.Current.TextColor1;
|
| | | btnText.Text = textValue;
|
| | | bodyFrameLayout.AddChidren(btnText);
|
| | | }
|
| | |
|
| | | #endregion
|
| | |
|
| | | #region ■ 一般方法___________________________
|