我有一个滚动视图,其中有一个UIView
包含内容的视图。我正在添加一个UIImageView
作为子的UIScrollView
(所以它应该在内容容器的顶部),这适用于 iPhone 3.2+,但在运行 3.1.3 的 iPhone 上,图像不会显示在容器上方。我的代码是这样的:
// 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)];
还有什么我想念的吗?谢谢!