我有一个滚动视图,其中有一个UIView
,其中包含内容。我添加了一个UIImageView
作为UIScrollView
的子版本(所以它应该位于内容容器的顶部),并且这适用于iPhone 3.2或更高版本,但在运行3.1.3的iPhone上,图像不会显示在容器上方。我的代码是这样的:addSubview在iOS 3.1.3上不显示视图
// add the content container
UIView *contentContainer = [[UIView alloc] init];
[scrollView addSubview:contentContainer];
// add content, etc
// this works in 3.2+
UIImageView *imageView = [[UIImageView alloc] initWithImage:image];
[scrollView addSubview:imageView];
// tried adding this for 3.1, but still didn't work
[scrollView bringSubviewToFront:imageView];
[imageView setFrame:CGRectMake(point.x, point.y, image.size.width, image.size.height)];
是否还有别的东西我失踪?谢谢!
升级到4.0:D – jmont 2010-07-16 17:01:34