RETableViewManager
RETableViewManager copied to clipboard
How to add a image of the option cell.
Hello,
I am a inde-developer in Korea. I think 'RETableViewManager' is really awesome. But I have a question. I am wondering how to add a image of the option cell. I am really want to know the way to insert some images on the cells of 'RETableViewOptionsController'. It means not background image on cell but square image on left of a cell
Thanks in advance
// Create the manager // self.manager = [[RETableViewManager alloc] initWithTableView:self.tableView];
// Add a section // RETableViewSection *section = [RETableViewSection sectionWithHeaderTitle:@"Test"]; [self.manager addSection:section];
// Add radio cell (options) //
__typeof (&*self) __weak weakSelf = self;
RERadioItem *radioItem = [RERadioItem itemWithTitle:@"Radio" value:@"Option 4" selectionHandler:^(RERadioItem *item) {
[item deselectRowAnimated:YES]; // same as [weakSelf.tableView deselectRowAtIndexPath:item.indexPath animated:YES];
// Generate sample options
//
NSMutableArray *options = [[NSMutableArray alloc] init];
for (NSInteger i = 1; i < 40; i++)
[options addObject:[NSString stringWithFormat:@"Option %li", (long) i]];
// Present options controller
//
RETableViewOptionsController *optionsController = [[RETableViewOptionsController alloc] initWithItem:item options:options multipleChoice:NO completionHandler:^{
[weakSelf.navigationController popViewControllerAnimated:YES];
[item reloadRowWithAnimation:UITableViewRowAnimationNone]; // same as [weakSelf.tableView reloadRowsAtIndexPaths:@[item.indexPath] withRowAnimation:UITableViewRowAnimationNone];
}];
// Adjust styles
//
optionsController.delegate = weakSelf;
optionsController.style = section.style;
if (weakSelf.tableView.backgroundView == nil) {
optionsController.tableView.backgroundColor = weakSelf.tableView.backgroundColor;
optionsController.tableView.backgroundView = nil;
}
// Push the options controller
//
[weakSelf.navigationController pushViewController:optionsController animated:YES];
}];
[section addItem:radioItem];
radioItem.image = [UIImage imaged:xx];