0
我正在實現一個抽屜單元。我現在使用我想要的一些自定義按鈕進行配置。不幸的是,按鈕沒有顯示。爲什麼我的按鈕不顯示在我的子視圖中?
感謝您的幫助
- (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...
}