2014-10-30 71 views
0

我在每個視圖控制器(頁面)上都有一個帶有uiImageViews的pageViewController。這些圖像是異步下載的。在任何翻轉發生之前更新第一頁沒有問題,但是一旦pageviewcontroller被翻開,當圖像改變時,當前打開的頁面不會更新。我如何讓當前的視圖控制器更新其視圖?更新UIPageViewController裏面的UIImageView圖像

-(void) updateImage:(UIImage *) image{ 
    MyCustomPage * dataViewController = [self.viewControllers lastObject]; 
    dataViewController.myImageView.image = image; 
} 

回答

0

這正是我需要的:

MyCustomPage * currentViewController = [self viewControllerAtIndex:currentPageNum]; 
NSArray *viewControllers = @[currentViewController]; 
[self.pageViewCntrl setViewControllers:viewControllers 
       direction:UIPageViewControllerNavigationDirectionForward 
       animated:NO 
       completion:nil]; 
+0

你的問題了20米你所需要回答。 – 2014-10-30 23:39:24

+0

是的,經過很長一段時間的努力之後,我發佈了這個問題,以便稍後找到解決方案。 – rEquation 2014-10-31 10:29:32