Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/iphone/39.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Iphone UITableViewStyleGrouped表格视图中单元格的自定义宽度_Iphone_Cocoa Touch_Uitableview - Fatal编程技术网

Iphone UITableViewStyleGrouped表格视图中单元格的自定义宽度

Iphone UITableViewStyleGrouped表格视图中单元格的自定义宽度,iphone,cocoa-touch,uitableview,Iphone,Cocoa Touch,Uitableview,在iPhone SDK中,是否有方法自定义样式为UITableViewStyleGroup的tableview中单元格的宽度 问题是我在cell.backgroundView中使用了一个290px的自定义背景图像宽度,但很明显这会被拉伸。我希望能够设置此单元格的自定义宽度,以便背景图像不会拉伸。您不能调用委托方法吗 -(CGFloat)tableView:(UITableView *)tableView widthForRowAtIndexPath:(NSIndexPath *)indexPat

在iPhone SDK中,是否有方法自定义样式为UITableViewStyleGroup的tableview中单元格的宽度


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

您不能调用委托方法吗

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

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

单元格的大小取决于表格的宽度

因为IPhoneSDK中没有这样的方法


对不起,我认为这行不通。我自己刚试过。UITableViewDelegate中没有宽度的方法
-(CGFloat)tableView:(UITableView *)tableView widthForRowAtIndexPath:(NSIndexPath *)indexPath
{
// width
return 300;
}