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...

    }
4

2 に答える 2

2

あなたが言う部分cell.frame、私は信じています。やってみてくださいCGRectMake(0, 0, cell.frame.size.width, cell.frame.size.height)。私もあなたがボタンにフレームを与えているのを見ませんか? checkbutton.frame = CGRectMake(...);

于 2013-03-23T20:30:41.840 に答える
0

ボタンのフレームを設定することはありません

于 2013-03-23T21:05:42.537 に答える