小编BC.*_*BC.的帖子

我需要示例代码在TableView中创建基于图像的自定义accessoryType

这是我对tableview自定义的代码.

如何将配件指示器设为图像(arrow.png)

-(UITableViewCell *)tableView : (UITableView *)tableView 
        cellForRowAtIndexPath : (NSIndexPath *)indexPath {

    static NSString * CellIdentifier = @ "Cell";

    UITableViewCell * cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
    if (cell == nil) {
        cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault 
                                       reuseIdentifier:CellIdentifier] autorelease];

        // Code to wrap the text within the cell for larger text
        cell.textLabel.lineBreakMode = UILineBreakModeWordWrap;
        cell.textLabel.numberOfLines = 0;
        cell.textLabel.font = [UIFont fontWithName:@ "Helvetica" size:17.0];
        UIImageView * separator = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@ "separator.png"]];
        separator.frame = CGRectMake((cell.frame.size.width - separator.frame.size.width) / 2, 
                                     CELL_HEIGHT - separator.frame.size.height, …
Run Code Online (Sandbox Code Playgroud)

iphone uitableview accessorytype

4
推荐指数
1
解决办法
1818
查看次数

标签 统计

accessorytype ×1

iphone ×1

uitableview ×1