これは私がこれまでに試したことです
グローバル変数を定義しました
float imgHeight;
次に、- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
私はこれを行います
size_t pixelsWide = CGImageGetWidth(scribbleImage.image.CGImage);
size_t pixelsHigh = CGImageGetHeight(scribbleImage.image.CGImage);
CGFloat ratio = 312/pixelsWide;
pixelsHigh = pixelsHigh*ratio;
次に- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
return pixlesHeight;
heightForRowAtIndexPath
が before と呼ばれるのでcellForRowAtIndexPath
、常に を取得しpixelsHeight as 0
ます。
これを行う別の方法がわかりません。heightForRow で UIImage を再定義してこれを行う必要があります
[scribbleImage setImageWithURL: [NSURL URLWithString:scribble[@"scribble_image"]] placeholderImage:[UIImage imageNamed:@"Default.png"]];
そこにも!? これを行う簡単な方法があるはずです。