Ios 在UIPageViewController内更新UIImageView图像
我有一个pageViewController,每个视图控制器页面上都有uiImageViews。图像是异步下载的。在任何翻页发生之前,我更新第一页都没有问题,但是一旦翻页打开pageviewcontroller,当前打开的页面在图像更改时不会更新。如何使当前视图控制器更新其视图Ios 在UIPageViewController内更新UIImageView图像,ios,uipageviewcontroller,Ios,Uipageviewcontroller,我有一个pageViewController,每个视图控制器页面上都有uiImageViews。图像是异步下载的。在任何翻页发生之前,我更新第一页都没有问题,但是一旦翻页打开pageviewcontroller,当前打开的页面在图像更改时不会更新。如何使当前视图控制器更新其视图 -(void) updateImage:(UIImage *) image{ MyCustomPage * dataViewController = [self.viewControllers lastObject]
-(void) updateImage:(UIImage *) image{
MyCustomPage * dataViewController = [self.viewControllers lastObject];
dataViewController.myImageView.image = image;
}
这就是我需要的:
MyCustomPage * currentViewController = [self viewControllerAtIndex:currentPageNum];
NSArray *viewControllers = @[currentViewController];
[self.pageViewCntrl setViewControllers:viewControllers
direction:UIPageViewControllerNavigationDirectionForward
animated:NO
completion:nil];
你的问题需要2000万美元才能回答。是的,经过长时间的努力,我发布了这个问题,但很快就找到了解决办法。