resize a image in table view cell... i am new programmer
by this code image comes in cell... but i wants resize image according to my need....
if possible give me little code... thanks in advance...
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:[NSString stringWithFormat:@"Cell %i",indexPath.section]];
if (cell == nil) {
//.......
}
search_items *pro = [result objectAtIndex:0];
if(indexPath.row==0)
{
NSString *filepath=[[NSBundle mainBundle]pathForResource:pro.s_image ofType:@"png"];
UIImage *image=[UIImage imageWithContentsOfFile:filepath];
cell.imageView.contentMode = UIViewContentModeScaleAspectFit;
//[cell.imageView setContentMode:UIViewContentModeScaleAspectFit];
[cell.imageView setFrame:CGRectMake(50,50,100,100)];
/*
CGRect iframe = cell.imageView.frame;
iframe.size.height = 100.0;
iframe.size.width=300.0;
cell.imageView.frame = iframe;
*/
cell.imageView.image=image;
}
}