我希望一次在UIScrollView
内显示4种不同的动画,所有动画都有200多帧,所以我认为解决此问题的最佳解决方案是显示视频。它比动画花费更少的内存。我的视频尺寸约为500x300,我希望将它们显示为250x150。我怎么能这样做?
答案 0 :(得分:0)
这必须是你问题的解决方案
- (void)layoutScrollImages
{
UIView *view = nil;
NSArray *subviews = [self.scrollView subviews];
// reposition all image subviews in a horizontal serial fashion
CGFloat curXLoc = 0;
for (view in subviews)
{
if ([view isKindOfClass:[UIView class]] && view.tag > 0)
{
CGRect frame = view.frame;
frame.origin = CGPointMake(curXLoc, 0);
view.frame = frame;
curXLoc += (kScrollObjWidth);
}
}
// set the content size so it can be scrollable
//[self.scrollView setContentSize:CGSizeMake((numImages * kScrollObjWidth), [self.scrollView bounds].size.height)];
[self.scrollView setContentSize:CGSizeMake((numImages * kScrollObjWidth), kScrollObjHeight)];
}