2013-05-28 54 views
-1

我想将UIPageViewController的背页颜色从白色更改为某些图像。我试图从以前的stackoverflow建议实现它但我无法得到如何做到这一点。任何人都可以向我建议我到底需要做什么?如何在UIPageViewController中设置backView颜色

-(void) createPages{ 
    self.pages = [[NSMutableArray alloc]initWithCapacity:6]; 
    CountViewController *controller; 
    UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"MainStoryboard" bundle:[NSBundle mainBundle]]; 
    for (int i = 0; i < 6; i++) { controller = [storyboard instantiateViewControllerWithIdentifier:@"countView"]; 
    controller.pageNumber = [NSNumber numberWithInt:i]; 
    [controller.view setUserInteractionEnabled:YES]; 
    [self.pages addObject:controller]; 
    } 
} 
+0

把一些代码。你如何创建pageview – Durgaprasad

+0

- (void)createPages {0} {0} {0} {0} self.pages = [[NSMutableArray alloc] initWithCapacity:6]; CountViewController * controller;你可以使用它来创建你自己的主题,你可以使用它来创建你自己的主题。 (int i = 0; i <6; i ++){ controller = [storyboard instantiateViewControllerWithIdentifier:@“countView”]; controller.pageNumber = [NSNumber numberWithInt:i]; [controller.view setUserInteractionEnabled:YES]; [self.pages addObject:controller]; } } – RashmiG

回答

1

您正在看到窗口背景颜色。你应该设置窗口背景颜色:

appDelegate.window.backgroundColor = [UIColor blackColor]; 
+0

我不想总是黑色。我想改变它根据前视图bgImage&我试着用appDelegate.window.backgroundColor = [UIColor blackColor];但没有变化.. – RashmiG