Exemplo n.º 1
0
        public SectionSize(TableView tableView, AbstractTableViewDataSource datasource, int section, float offset)
        {
            int rowCount = datasource.GetNumberOfRows(tableView, section);

            rows    = new float[rowCount + 1];
            rows[0] = offset;
            if (rowCount > 0)
            {
                rows[1] = offset + datasource.GetHeaderHeight(tableView, section);
                for (int i = 2; i <= rowCount; i++)
                {
                    rows[i] = rows[i - 1] + datasource.GetRowHeight(tableView, section, i - 1) + datasource.GetRowSpacing(tableView, section);
                }
            }

            HasHeader = datasource.GetHeaderHeight(tableView, section) > 0;
            Top       = rows[0];
            if (rowCount == 0)
            {
                Bottom = rows[rows.Length - 1] + datasource.GetHeaderHeight(tableView, section) + datasource.GetRowSpacing(tableView, section);
            }
            else
            {
                Bottom = rows[rows.Length - 1] + datasource.GetRowHeight(tableView, section, rowCount) + datasource.GetRowSpacing(tableView, section);
            }
        }
Exemplo n.º 2
0
 public int NumberOfRows(int section)
 {
     return(datasource.GetNumberOfRows(this, section));
 }