陈嘉乐
2020-05-15 d5b9ff8bf8cc36f5b13c46b66682f5988d3a6f36
ZigbeeApp/Shared/Phone/CommonForm/EditorCommonForm.cs
@@ -15,6 +15,10 @@
        #region ■ 变量声明___________________________
        /// <summary>
        /// 返回按键的点击事件(如果实现此事件,则底层的事件将不会再触发)
        /// </summary>
        public Action<BackViewControl> BackButtonClickEvent = null;
        /// <summary>
        /// TopMenuFrameLayout
        /// </summary>
        public FrameLayout topMenuFrameLayout = null;
@@ -31,7 +35,7 @@
        /// </summary>
        private bool m_ScrollEnabled = true;
        /// <summary>
        /// 左滑使能
        /// 左滑使能(界面关闭时,底层会还原,无需再处理)
        /// </summary>
        public bool ScrollEnabled
        {
@@ -124,6 +128,12 @@
            btnBack.InitControl();
            btnBack.ButtonClickEvent += (sender, e) =>
            {
                if (this.BackButtonClickEvent != null)
                {
                    //如果实现此事件,则底层的事件将不会再触发
                    BackButtonClickEvent(btnBack);
                    return;
                }
                //画面关闭
                this.CloseForm();
            };
@@ -134,7 +144,7 @@
            txttitle.Name = "txtTitle";
            txttitle.TextSize = 17;
            txttitle.X = Application.GetRealWidth(161);
            txttitle.Height = Application.GetRealHeight(69);
            txttitle.Height = Application.GetRealHeight(75);
            txttitle.Width = Application.GetRealWidth(850);
            txttitle.Gravity = Gravity.CenterVertical;
            txttitle.TextColor = UserCenterColor.Current.TopLayoutTitleText;
@@ -209,6 +219,8 @@
            //左滑使能
            this.ScrollEnabled = true;
            this.BackButtonClickEvent = null;
            this.m_parameter = null;
            //清空bodyFrame
@@ -380,7 +392,11 @@
            {
                return;
            }
            bodyFrameLayout?.RemoveAll();
            if (bodyFrameLayout == null || bodyFrameLayout.Parent == null)
            {
                return;
            }
            bodyFrameLayout.RemoveAll();
        }
        #endregion
@@ -408,6 +424,16 @@
            back?.RemoveFromParent();
        }
        /// <summary>
        /// 获取返回键
        /// </summary>
        public BackViewControl GetBackButton()
        {
            //移除返回键
            var back = (BackViewControl)topFrameLayout.GetTagByKey("btnBack");
            return back;
        }
        #endregion
    }
}