views:

231

answers:

2

In the iPhone SDK, is there a way to customize the width of the cells in a tableview that is having the style of UITableViewStyleGrouped?

The problem is that I am using an custom background image (width of 290px) for the cell.backgroundView but apparently that gets stretched. I want to be able to set the custom width of this cell so the background image doesn't stretch.

A: 

Can you not call the delegate method

-(CGFloat)tableView:(UITableView *)tableView widthForRowAtIndexPath:(NSIndexPath *)indexPath
{
// width
return 300;
}
cdnicoll
Sorry I don't think this will work. I just tried it out myself.
cdnicoll
There is no method for width in the UITableViewDelegate
Daniel Wood
A: 

Just resize the tableView as per your requirement ..........either from Nib or programmatically.....

size of cell depends on the width of table.

because there is not such any method in IPhoneSDK

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

Ajay Sharma