I want to make an option for my users that they can choose what kind of list in the UITableView they want.
In my UITableView, I have made 2 prototype cells. The user can switch between these 2 cell types. But the cell won't change his size;
Before switch: http://imgbox.com/kMQOiSeI
After switch: http://imgbox.com/tEBBla81
Now I switch between these in the cellForRowIndexPath;
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
NSString *voorkeur = [[NSUserDefaults standardUserDefaults] objectForKey:@"voorkeur"];
static NSString *CellIdentifier;
if ([voorkeur isEqualToString:@"groot"]) {
CellIdentifier = @"CustomCell2";
} else {
CellIdentifier = @"CustomCell";
}
CustomCell *Cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (Cell == nil) {
Cell = [[CustomCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier];
}
(...)
}
What can I do to make this work?
Thanks!