2013-05-28 48 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