Iphone pageviewcontroller重叠工具栏中的PageCurlEffect

Iphone pageviewcontroller重叠工具栏中的PageCurlEffect,iphone,objective-c,ios6,uipageviewcontroller,page-curl,Iphone,Objective C,Ios6,Uipageviewcontroller,Page Curl,每当我翻页时,在pageviewcontroller中使用Pagecurleffect,它与工具栏重叠 这是我的密码 - (void)viewDidLoad { [super viewDidLoad]; modelArray = [[NSMutableArray alloc] init]; for (int index = 1; index <= totalPages; index++) { [modelArray addObject:[NSString stringWit

每当我翻页时,在pageviewcontroller中使用Pagecurleffect,它与工具栏重叠

这是我的密码

- (void)viewDidLoad {

[super viewDidLoad];

modelArray = [[NSMutableArray alloc] init];

for (int index = 1; index <= totalPages; index++) {

    [modelArray addObject:[NSString stringWithFormat:@"%i", index]];

}

thePageViewController = [[UIPageViewController alloc] initWithTransitionStyle:UIPageViewControllerTransitionStylePageCurl navigationOrientation: UIPageViewControllerNavigationOrientationHorizontal options:nil];

thePageViewController.delegate = self;
thePageViewController.dataSource = self;

thePageViewController.view.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;

contentViewController = [[ContentViewController alloc] initWithPDF:PDFDocument];
contentViewController.page = [modelArray objectAtIndex:0];
NSArray *viewControllers = [NSArray arrayWithObject:contentViewController];
[thePageViewController setViewControllers:viewControllers direction:UIPageViewControllerNavigationDirectionForward animated:NO completion:nil];

[self addChildViewController:thePageViewController];
[self.view addSubview:thePageViewController.view];
thePageViewController.view.frame = CGRectMake(0, 0, self.view.frame.size.width, self.view.frame.size.height);


[thePageViewController didMoveToParentViewController:self];

}
翻页时与工具栏重叠不好看。我怎样才能解决这个问题

我想要第二张照片

它是在导航栏下翻页,而不是与导航栏重叠。
谢谢

您正在每个页面中添加一个工具栏,它位于页面内部


您必须在第一块代码上创建工具栏,并添加
[self.view bringSubviewToTop:_toolbar]结尾

你能提供一个屏幕截图来帮助我们看到发生了什么吗?从simulatori添加的屏幕截图在pageviewcontroller中添加了工具栏,现在它工作正常,以前它在content view控制器中。我没有添加这段代码[self.view带来subviewtotop:_toolbar];使用相同的[self.view addSubview:_toolbar];现在它工作得很好。非常感谢你的帮助。
   - (void)viewDidLoad
   {
[super viewDidLoad];


// Create our PDFScrollView and add it to the view controller.
CGPDFPageRef PDFPage = CGPDFDocumentGetPage(thePDF, [_page intValue]);



pdfScrollView = [[PDFScrollView alloc] initWithFrame:CGRectMake(0, 46, self.view.bounds.size.width, 915)];
[pdfScrollView setPDFPage:PDFPage];
[self.view addSubview:pdfScrollView];



    self.view.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
    pdfScrollView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;

_toolbar = [[UIToolbar alloc] initWithFrame:CGRectMake(0, 965, self.view.bounds.size.width, 40)];

_toolbar.barStyle = UIBarStyleBlackOpaque;

[self.view addSubview:_toolbar];

   }