也许是一个巨大的noob问题,但我似乎无法弄清楚,即使经过一段时间谷歌搜索我无法找到安排滚动浏览underneeth导航栏。排列UIscrollView返回
我的代码:
- (void)loadView {
UIScrollView *scroll = [[UIScrollView alloc] initWithFrame:[[UIScreen mainScreen] applicationFrame]];
scroll.backgroundColor = [UIColor blackColor];
scroll.delegate = self;
image = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"Plattegrond DeFabrique schematisch.png"]];
scroll.contentSize = image.frame.size;
[scroll addSubview:image];
scroll.minimumZoomScale = scroll.frame.size.width/image.frame.size.width;
scroll.maximumZoomScale = 2.0;
[scroll setZoomScale:scroll.minimumZoomScale];
self.view = scroll;
}
这将导致无限递归,因为获得'self.view'调用'loadView'。 – 2013-05-06 15:48:15
那么没有工作:我这样做: self.view = scroll; [self.view sendSubviewToBack:scroll]; – 2013-05-06 15:52:17
你为什么设置self.view = scroll?只需将子视图添加到self.view,滚动视图就会出现在navBar下面。 – 2013-05-06 15:52:29