黄学彪
2020-12-17 6c0c799c1f5da2d215ec8d9df9b92b3d1948dc14
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
using System;
using HDL_ON.UI.CSS;
using Shared;
 
namespace HDL_ON.UI
{
    /// <summary>
    /// WebViewDialog
    /// 加载网页
    /// </summary>
    public class WebViewDialog : Dialog
    {
        /// <summary>
        /// bodyView
        /// </summary>
        FrameLayout bodyView;
 
        /// <summary>
        /// WebViewDialog
        /// </summary>
        public WebViewDialog()
        {
            bodyView = new FrameLayout();
        }
 
        /// <summary>
        /// 加载页面
        /// </summary>
        /// <param name="titleStr"></param>
        /// <param name="url"></param>
        public void LoadPage(string titleStr, string url)
        {
            bodyView.BackgroundColor = CSS_Color.MainBackgroundColor;
            this.AddChidren(bodyView);
            new TopViewDiv(this, bodyView, titleStr).LoadTopView();
 
            //WebView
            var webView = new WebView() {
                Y = Application.GetRealHeight(64),
                Height = bodyView.Height - Application.GetRealHeight(64),
                X = Application.GetRealWidth(16),
                Width = bodyView.Width - Application.GetRealWidth(32)
            };
            bodyView.AddChidren(webView);
 
            //加载网址
            webView.LoadRequest(url);
            this.Show();
        }
    }
}