【发布时间】:2013-02-02 20:36:33
【问题描述】:
我正在尝试在 UINavigationController 中使用此代码:
http://developer.apple.com/library/ios/#samplecode/PhotoScroller/Introduction/Intro.html
在故事板中:
- 我在导航控制器中嵌入了 PageViewController。
- 我将 Topbar 更改为“NavigationBar”。
- 我在 NavigationBar 中添加了一个标题:“ImageView”。
- 我向 PageViewController 和 NavigationController 添加了故事板 ID。
在 ImageViewScrollView.m 中:
- (void)displayTiledImageNamed:(NSString *)imageName size:(CGSize)imageSize
我改变了这一行:
_zoomView = [[UIImageView alloc] initWithFrame:(CGRect){CGPointZero, imageSize }];
通过这些:
CGPoint navPoint = CGPointMake(0, 45);
_zoomView = [[UIImageView alloc] initWithFrame:(CGRect){navPoint, imageSize}];
我也改变了这些行:
- (CGPoint)minimumContentOffset
{
return CGPointZero;
}
通过这些:
- (CGPoint)minimumContentOffset
{
CGPoint navPoint = CGPointMake(0, 45);
return navPoint;
}
当我使用 iOS 模拟器时,我看不到导航栏。替换 CGPointZero 是不够的。
怎么了?
【问题讨论】:
标签: ios uinavigationcontroller