I am trying to build a form using a static UiTableViewController - I want to implement the IOS7 reveal method to display UIPickerView / UidateView inline, but its proving to be problematic due to the table being static rather than dynamic.
Anyhow - I've followed the solution by Aaron Bratcher in this question - iOS 7 - How to display a date picker in place in a table view? -
Looks like it would fit perfectly - my only issue is that my table cells are of varying heights - so I need to return either height of 200 or zero for the date picker row - but for everything else they need to keep their current height - I'm not sure whats the best way to code this - I need to reference the current cell and basically say stay as you are unless your the pickerRow?
This is what Ive got so far -
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
if (indexPath.section == 5 && indexPath.row == 1) { // this is my picker cell
if (_editingStartTime) {
return 220;
} else {
return 0;
}
} else {
UITableViewCell *cell = [tableView cellForRowAtIndexPath:indexPath];
//return THE CURRENT CELLS HEIGHT
}
}
Not sure how i'd access the height of cell above - or even whether that logic would do what i want it to do in heightForRowAtIndexPath? any ideas?
Cheers