WJC
2020-03-26 eed381ca472abb06e386281e604569ebf80bbfe3
ZigbeeApp/Shared/Phone/Device/Logic/LogicCommunalPage.cs
@@ -1324,50 +1324,7 @@
            };
        }
        /// <summary>
        /// 闪现式提示框的方法
        /// </summary>
        /// <param name="tipText">提示内容</param>
        /// <param name="second">停留时间单位为s</param>
        public void TipView(string tipText, int second = 1)
        {
            var frameLayout = new FrameLayout { BackgroundColor = 0x50000000 };
            this.AddChidren(frameLayout);
            var btn = new Button
            {
                Gravity = Gravity.Center,
                Text = tipText,
                BackgroundColor = 0xff1f1f1f,
                Width = Application.GetRealWidth(500),
                Height = Application.GetRealHeight(100),
                Radius = (uint)Application.GetRealHeight(50),
            };
            frameLayout.AddChidren(btn);
            var dateTime1 = DateTime.Now;
            new System.Threading.Thread(() =>
            {
                Application.RunOnMainThread(() =>
                {
                    while (true)
                    {
                        if ((DateTime.Now - dateTime1).TotalMilliseconds > second * 1000)
                        {
                            //默认一秒关闭
                            frameLayout.RemoveFromParent();
                            break;
                        }
                    }
                });
            })
            { IsBackground = true }.Start();
        }
    }
}