BruceLee
2019-09-24 a9f88790c31c8b61d9b90241c4df258a980f1c00
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
52
53
using System;
using System.Collections.Generic;
using System.Text;
 
namespace Shared.Phone.UserCenter
{
    /// <summary>
    /// 做成一个上下可以滑动的列表控件(它会调整高度,无桌布)
    /// </summary>
    public class VerticalListControl : VerticalScrolViewLayout
    {
        #region ■ 变量声明___________________________
 
        /// <summary>
        /// 行之间的间距
        /// </summary>
        public int rowSpace = 0;
 
        #endregion
 
        #region ■ 初始化_____________________________
 
        /// <summary>
        /// 做成一个上下可以滑动的列表控件(它会调整高度,无桌布)
        /// </summary>
        /// <param name="i_rowSpace">行之间的间距(这个值是与行控件绑定一起使用的)</param>
        public VerticalListControl(int i_rowSpace = 0)
        {
            rowSpace = Application.GetRealHeight(i_rowSpace);
        }
 
        #endregion
 
        #region ■ 添加子控件_________________________
 
        /// <summary>
        /// 添加子控件(FrameRowControl,RowLayoutControl会改变高度)
        /// </summary>
        /// <param name="view"></param>
        public override void AddChidren(View view)
        {
            base.AddChidren(view);
            if (view is FrameRowControl || view is RowLayoutControl)
            {
                if (rowSpace > 0)
                {
                    view.Height += rowSpace;
                }
            }
        }
        #endregion
    }
}