private void HandleCellSelectedEvent(SegmentedControl _, int cellIdx) { selectedGroup?.OnDisable(); selectedGroup = loadedSettingsGroups[cellIdx]; selectedGroup.OnEnable(); tableList.data.Clear(); tableList.cellSize = selectedGroup.GetSize(); for (var i = 0; i < selectedGroup.NumberOfCells(); i++) { tableList.data.Add(selectedGroup.CellInfoForIdx(i)); } tableList.tableView.ReloadData(); tableList.tableView.ScrollToCellWithIdx(0, TableView.ScrollPositionType.Beginning, false); tableList.tableView.SelectCellWithIdx(selectedGroup.CellToSelect(), false); ScrollView_scrollPositionChangedEvent(0f); }
// Tune this to the amount of cells you'll have, whether dynamic or static. public int NumberOfCells() => selectedSettingsGroup?.NumberOfCells() ?? 0;
public int NumberOfCells() => selectedSettingsGroup?.NumberOfCells() ?? 0; //Tune this to the amount of cells you'll have, whether dynamic or static.