| | |
| | | /// <summary> |
| | | /// 返回键 |
| | | /// </summary> |
| | | public BackButton backButton; |
| | | public UserCenter.BackViewControl backButton; |
| | | /// <summary> |
| | | /// 状态栏-高度为80 |
| | | /// </summary> |
| | |
| | | /// <summary> |
| | | /// 构造方法 |
| | | /// </summary> |
| | | public TopFrameLayout(FrameLayout parentFrameLayout) |
| | | public TopFrameLayout() |
| | | { |
| | | BackgroundColor = ZigbeeColor.Current.GXCTopViewBackgroundColor; |
| | | Width = Application.GetRealWidth(1080); |
| | | Height = Application.GetRealHeight(CommonFormRrsouce.TopFrameLayout_Height); |
| | | //先加载到父容器,否则子控件布局有问题 |
| | | parentFrameLayout.AddChidren(this); |
| | | //初始化 |
| | | InitTopview(parentFrameLayout); |
| | | Width = Application.GetRealWidth(CommonFormResouce.AppRealWidth); |
| | | Height = Application.GetRealHeight(CommonFormResouce.TopFrameLayout_Height); |
| | | } |
| | | |
| | | #endregion |
| | | |
| | | #region ◆ 初始化__________________________ |
| | | |
| | | private void InitTopview(FrameLayout parentFrameLayout) |
| | | public void InitTopview() |
| | | { |
| | | //状态栏 |
| | | AddTopStatuFrame(); |
| | | //topview |
| | | AddTopview(); |
| | | //添加返回键 |
| | | AddBackBtn(parentFrameLayout); |
| | | AddBackBtn(); |
| | | //标题 |
| | | AddTitle(); |
| | | } |
| | |
| | | { |
| | | topView = new FrameLayout |
| | | { |
| | | Y = Application.GetRealHeight(CommonFormRrsouce.TopStatuFrameLayout_Height), |
| | | Height = Application.GetRealHeight(CommonFormRrsouce.Topview_Height), |
| | | Width = Application.GetRealWidth(1080) |
| | | Y = Application.GetRealHeight(CommonFormResouce.TopStatuFrameLayout_Height), |
| | | Height = Application.GetRealHeight(CommonFormResouce.Topview_Height), |
| | | Width = Application.GetRealWidth(CommonPage.AppRealWidth), |
| | | BackgroundColor=ZigbeeColor.Current.GXCTopViewBackgroundColor |
| | | }; |
| | | AddChidren(topView); |
| | | |
| | | var line = new Button |
| | | { |
| | | Y=Height-1, |
| | | Height=1, |
| | | BackgroundColor= UserCenter.UserCenterColor.Current.ButtomLine |
| | | }; |
| | | AddChidren(line); |
| | | } |
| | | |
| | | #endregion |
| | |
| | | /// 返回键 |
| | | /// </summary> |
| | | /// <returns>The back button.</returns> |
| | | private void AddBackBtn(FrameLayout parentFrameLayout) |
| | | private void AddBackBtn() |
| | | { |
| | | backButton = new BackButton { }; |
| | | topView.AddChidren(backButton); |
| | | |
| | | backButton.MouseUpEventHandler += (sender, e) => |
| | | { |
| | | parentFrameLayout.RemoveFromParent(); |
| | | }; |
| | | backButton = new UserCenter.BackViewControl(); |
| | | topView.AddChidren(backButton);
|
| | | backButton.InitControl(); |
| | | //后续再调整 |
| | | backButton.Y = backButton.Y - Application.GetRealHeight(4); |
| | | } |
| | | |
| | | #endregion |
| | |
| | | { |
| | | topStatuFrameLayout = new FrameLayout |
| | | { |
| | | Height = Application.GetRealHeight(CommonFormRrsouce.TopStatuFrameLayout_Height), |
| | | Width = Application.GetRealWidth(1080) |
| | | Height = Application.GetRealHeight(CommonFormResouce.TopStatuFrameLayout_Height), |
| | | Width = Application.GetRealWidth(CommonPage.AppRealWidth) |
| | | }; |
| | | AddChidren(topStatuFrameLayout); |
| | | } |
| | |
| | | /// 标题 |
| | | /// </summary> |
| | | private void AddTitle() |
| | | { |
| | | topTitle = new Button |
| | | { |
| | | Height = Application.GetRealHeight(CommonFormRrsouce.TopFrameLayout_Height - CommonFormRrsouce.TopStatuFrameLayout_Height), |
| | | Width = Application.GetRealWidth(CommonFormRrsouce.TopTitle_Width), |
| | | TextSize = CommonFormRrsouce.TopTitle_TextSize, |
| | | TextColor = ZigbeeColor.Current.GXCTextBlackColor, |
| | | Gravity = Gravity.CenterHorizontal, |
| | | }; |
| | | {
|
| | | topTitle = new Button(); |
| | | topTitle.TextSize = 17; |
| | | topTitle.X = Application.GetRealWidth(161); |
| | | topTitle.Height = Application.GetRealHeight(75); |
| | | topTitle.Width = Application.GetRealWidth(850); |
| | | topTitle.Gravity = Gravity.CenterVertical; |
| | | topTitle.TextColor = UserCenter.UserCenterColor.Current.TopLayoutTitleText;
|
| | | topTitle.TextAlignment = TextAlignment.CenterLeft;
|
| | | topTitle.IsBold = true; |
| | | |
| | | topView.AddChidren(topTitle); |
| | | } |
| | | /// <summary> |
| | |
| | | { |
| | | topTitle.Text = title; |
| | | } |
| | | /// <summary> |
| | | /// 设置标题 |
| | | /// </summary> |
| | | /// <param name="title"></param> |
| | | public void SetTopTitle(int title) |
| | | { |
| | | SetTopTitle(Language.StringByID(title)); |
| | | } |
| | | |
| | | #endregion |
| | | } |