где можно найти пример добавления UIButton в каждую UITableCell - PullRequest
0 голосов
/ 09 июня 2010

Где можно найти пример добавления UIButton в каждую UITableCell?

1 Ответ

0 голосов
/ 22 марта 2011

Вам нужно создать UIbutton и jus addSubView для cell, это будет нормально работать.

    - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
     static NSString *CellIdentifier = @"Cell";
        UIImageView * accerTypeImage;
        UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
        if (cell == nil) {
            cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease];
        }

        UIButton *button = [[UIButton allo] init];
        button.frame = //give the frame in UITableViewCell.
        button.tag = indexPath.row;
        [cell addSubView:button];
        [button release];
return cell;

        }
Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...