【问题标题】:show a detaildisclosure button to the uitableview without custom cell在没有自定义单元格的情况下向 uitableview 显示详细信息披露按钮
【发布时间】:2010-03-08 06:26:06
【问题描述】:

如何在不使用自定义单元格的情况下向 uitableview 显示详细信息披露按钮。我通过使用附件类型:方法知道它,但不知道如何实现..请帮助..

【问题讨论】:

    标签: iphone uitableview accessorytype


    【解决方案1】:

    // 自定义表格视图单元格的外观。

    - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath 
    {
    
        static NSString *CellIdentifier = @"Cell";
        UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
        if (cell == nil)
        {
            cell = [[[UITableViewCell alloc] initWithFrame:CGRectZero reuseIdentifier:CellIdentifier] autorelease];
        }
        [cell setAccessoryType:UITableViewCellAccessoryDetailDisclosureButton];
        return cell;
    }
    

    [单元格 setAccessoryType:UITableViewCellAccessoryDe​​tailDisclosureButton];

    【讨论】:

      【解决方案2】:
      cell.accessoryType = UITableViewCellAccessoryDetailDisclosureButton;
      

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2023-03-27
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2012-02-21
        相关资源
        最近更新 更多