如何設置ImageView在tableView動態居中?
當前的代碼如下:
UIImageView *imgView = [ [UIImageView alloc] initWithFrame:CGRectMake(100,100, 20, 20)];
imgView.image = [UIImage imageNamed:@"friendsCelluserpic.png"];
cell.imageView.image = imgView.image;
自定義一個UITableViewCell ,或者通過嘗試修改cell.imageView的frame來實現
UIImage *img=[UIImage imageNamed:@"friendsCelluserpic.png"];
cell.imageView.image = img;
cell.imageView.frame=CGRectMake((cell.frame.size.width-img.size.width)/2, (cell.frame.size.height-img.size.height)/2,img.size.width,img.size.height);