代码之家  ›  专栏  ›  技术社区  ›  Ronnie Liew

UITableViewStyleGrouped tableviews中单元格的自定义宽度

  •  1
  • Ronnie Liew  · 技术社区  · 14 年前

    问题是我在cell.backgroundView中使用了一个自定义的背景图像(宽度为290px),但是很明显,它被拉伸了。我想能够设置此单元格的自定义宽度,这样背景图像就不会拉伸。

    2 回复  |  直到 14 年前
        1
  •  -1
  •   Vikas S Singh Poorva    12 年前

    只需根据您的要求调整tableView的大小……….从Nib或以编程方式。。。。。

    -(CGFloat)tableView:(UITableView *)tableView widthForRowAtIndexPath:(NSIndexPath *)indexPath
    {
    // width
    return 300;
    } 
    
        2
  •  -2
  •   cdnicoll    14 年前

    -(CGFloat)tableView:(UITableView *)tableView widthForRowAtIndexPath:(NSIndexPath *)indexPath
    {
    // width
    return 300;
    }