When i load the page its normal pls check below image
and when i click on a row ,then the corresponding image is showing in different size , Please check the below image(when i click 1st and 2nd row)
Please help me to solve this issue. Here am using SDWebImage for lazy loading of images from url.
My code:
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{
return 1; //count of section
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
return [names count]; //count number of row from counting array hear cataGorry is An Array
}
- (UITableViewCell *)tableView:(UITableView *)tableView
cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *MyIdentifier = @"service";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:MyIdentifier];
if (cell == nil)
{
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault
reuseIdentifier:MyIdentifier]
;
}
// Here we use the provided setImageWithURL: method to load the web image
// Ensure you use a placeholder image otherwise cells will be initialized with no image
// cell.imageView.frame=CGRectMake(5,10,50,60);
cell.imageView.layer.cornerRadius=8.0;
cell.imageView.clipsToBounds=YES;
cell.imageView.autoresizingMask=UIViewAutoresizingFlexibleHeight;
[cell.imageView setImageWithURL:[NSURL URLWithString:[imaages objectAtIndex:indexPath.row]]placeholderImage:[UIImage imageNamed:@"Placeholder.png"]];
cell.textLabel.text = [names objectAtIndex:indexPath.row];
cell.backgroundColor=[UIColor clearColor];
return cell;
}
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
{
return 80;
}
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
}