I have UITableView with custom UITableViewCells. The Cells contain a custom view, which is a slightly modified version of SSCheckBoxView (available on GitHub)
When I scroll within the TableView and a cells disappears from the screen, the custom view is cut off when it reappears.
Before scrolling my cells look like this: https://www.dropbox.com/s/hcyvgumhr7t1fxg/before.png
And this is what the view looks like when it reappears: https://www.dropbox.com/s/p6wirtj60ffssxm/after.png
Here is my cellForRowAtIndexPath Method in my TableViewController
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
static NSString *myIdentifier = @"CarpartTableViewCell";
CarpartTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:myIdentifier];
if (cell == nil) {
cell = (CarpartTableViewCell*) [[[NSBundle mainBundle] loadNibNamed:@"CarpartTableViewCell"
owner:self
options:nil] objectAtIndex:0];
}
cell.delegate = self;
cell.tag = indexPath.row;
Carpart *part = [_parts objectAtIndex:indexPath.row];
cell.carpart.text = part.name;
[cell.checkboxMaterial setText:@"Alubauteil"];
[cell.checkboxPushing setText:@"Vordrücken"];
cell.checkboxMaterial.checked = part.material.boolValue;
cell.checkboxPushing.checked = part.pushing.boolValue;
cell.checkboxPushing.tag = indexPath.row;
cell.checkboxMaterial.tag = indexPath.row;
[cell.checkboxMaterial setStateChangedTarget:self selector:@selector(materialChanged:)];
[cell.checkboxPushing setStateChangedTarget:self selector:@selector(pushingChanged:)];
return cell;
}