UIScrollView
何時間もの間、が からの画像を表示しない理由を理解しようとしてきましたNSMutableArray
。
uiimageview オブジェクトが UISCrollview 内のサブビュー コレクションにあることに気付きましたが、どういうわけか UIViewContentModeScaleAspectFit は無視されます...どうすればスケールに合わせることができますか?
ヒントはありますか?
- (void)viewDidLoad
{
[super viewDidLoad];
BookDalc* bookDalc = [[BookDalc alloc] init];
NSMutableArray* books = [bookDalc FindByIconID:IconID];
for(int i = 0;i<books.count;i++)
{
CGRect frame;
frame.origin.x = self.scrBook.frame.size.width * i;
frame.origin.y = 0;
frame.size = self.scrBook.frame.size;
UIImageView *subview = [[UIImageView alloc] initWithFrame:frame];
subview.contentMode = UIViewContentModeScaleAspectFit;
BookEntity *currentModel = [books objectAtIndex:i];
UIImage *currentImage = [currentModel TheImage];
subview.image = currentImage;
[self.scrBook addSubview:subview];
}
self.scrBook.contentSize
= CGSizeMake(self.scrBook.frame.size.width * books.count, self.scrBook.frame.size.height);
}