iPhone получит ширину и размер изображения

Его может быть одним из методов протокола UITableViewDataSource

. Для

- tableView:numberOfRowsInSection:

он должен вернуть целое число, равное сумме или результату

-insertRowsAtIndexPaths:withRowAnimation: и / или -deleteRowsAtIndexPaths:withRowAnimation:

Для

- numberOfSectionsInTableView:

он должен вернуть целое число, равное сумме или результату

-insertRowsAtIndexPaths:withRowAnimation: и / или -deleteSections:withRowAnimation:

13
задан jxh 6 August 2013 в 19:39
поделиться

3 ответа

Well, if you have the image as UIImage, then you want to take a look at the size property:

CGFloat width = myImage.size.width;
CGFloat height = myImage.size.height;
34
ответ дан 1 December 2019 в 18:49
поделиться

You can try to check

[[UIImage imageNamed:@"myImage.png"] size].height;
[[UIImage imageNamed:@"myImage.png"] size].width;
6
ответ дан 1 December 2019 в 18:49
поделиться

Возможно, это тоже вам поможет:

UIImage *image = [ UIImage imageNamed: @"image.png" ];
imageView.bounds = CGRectMake(0, 0, image.size.width, image.size.height);
3
ответ дан 1 December 2019 в 18:49
поделиться
Другие вопросы по тегам:

Похожие вопросы: