黄学彪
2020-12-16 0d9f64668fd7350d6a21fd157e32009a96d98134
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
using System;
using System.Collections.Generic;
using System.Text;
 
namespace Shared.Phone
{
    /// <summary>
    /// 做成一个TopFrameLayout的返回键✩
    /// </summary>
    public class BackViewControl : FrameLayoutStatuControl
    {
        /// <summary>
        /// 图标宽度
        /// </summary>
        private int iconWidth = 30;
 
        /// <summary>
        /// 做成一个TopFrameLayout的返回键✩
        /// </summary>
        public BackViewControl()
        {
            this.UseClickStatu = false;
            this.Name = "btnBack";
            this.X = HdlControlResourse.XXLeft - Application.GetRealWidth((110 - iconWidth) / 2);
            this.Width = this.GetPictrueRealSize(110);
            this.Height = this.GetPictrueRealSize(110);
            this.Gravity = Gravity.CenterVertical;
        }
 
        /// <summary>
        /// 初始化
        /// </summary>
        public void InitControl()
        {
            var btnIcon = new ButtonBase();
            btnIcon.Width = this.GetPictrueRealSize(30);
            btnIcon.Height = this.GetPictrueRealSize(51);
            btnIcon.UnSelectedImagePath = "Item/Back.png";
            btnIcon.Gravity = Gravity.Center;
 
            this.AddChidren(btnIcon, ChidrenBindMode.BindEvent);
            //这张图片好像很特殊,无法居中
            btnIcon.Y += Application.GetRealHeight(5);
        }
    }
}