我正在实现一个抽屉单元。我现在用一些我想要的自定义按钮来配置它。不幸的是,按钮没有显示。
谢谢您的帮助
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *CellIdentifier = @"Cell";
HHPanningTableViewCell *cell = (HHPanningTableViewCell*)[tableView dequeueReusableCellWithIdentifier:CellIdentifier];
NSInteger directionMask = indexPath.row % 5;
if (cell == nil) {
NSLog(@"Cell = nil.");
cell = [[HHPanningTableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier];
UIView *drawerView = [[UIView alloc] initWithFrame:cell.frame];
drawerView.backgroundColor = [UIColor greenColor];
cell.drawerView = drawerView;
UIImage *checkImage = [UIImage imageNamed:@"check.png"];
UIButton *checkButton = [UIButton buttonWithType:UIButtonTypeCustom];
[checkButton setImage:checkImage forState:UIControlStateNormal];
[drawerView addSubview:checkButton];
//[checkButton addTarget:nil action:(deleteListItem:) forControlEvents:UIControlEventTouchUpInside];
// Configure the cell...
}