0
-(void)viewDidLoad{
[self.view setBackgroundColor:[UIColor whiteColor]];
isInFullScreenMode = FALSE;

messageArrayCollection = [[NSMutableArray alloc] init];

for (int i = 1; i <= 18; i++) {

    MessageModel* messageModel1 = [[MessageModel alloc] init];
    messageModel1.messageID= i;
    messageModel1.userName = @"Kimberly A. Mann";
    messageModel1.userImage =  @"MWMStaff.png";
    messageModel1.createdAt = @"06/07/2011 at 01:00 AM";
    messageModel1.content = @"After raising her two children, Kim joined the Monument Wealth Management team in 2009, managing the book keeping and other office tasks.In her free time, Kim enjoys spending time with her family, attending festive events and parades, and catching up on her favorite shows – Dancing with the Stars and Smash, to name a few";


    [messageArrayCollection addObject:messageModel1];
    //[messageModel1 release];
}

[self buildPages:messageArrayCollection];

flipper = [[AFKPageFlipper alloc] initWithFrame:self.view.bounds];
flipper.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
flipper.dataSource = self;
[self.view addSubview:flipper];
}


-(void)showViewInFullScreen:(UIViewExtention*)viewToShow withModel:(MessageModel*)model{
   NSLog(@" in show view inFullscreen");
  if (!isInFullScreenMode) {
    isInFullScreenMode = TRUE;

    CGRect bounds = [UIScreen mainScreen].bounds;
    if (self.interfaceOrientation == UIInterfaceOrientationLandscapeLeft || self.interfaceOrientation == UIInterfaceOrientationLandscapeRight) {
        CGFloat width = bounds.size.width;
        bounds.size.width = bounds.size.height;
        bounds.size.height = width;
    }


    fullScreenBGView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, bounds.size.width, bounds.size.height)];
    fullScreenBGView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
    [fullScreenBGView setBackgroundColor:RGBACOLOR(0,0,0,0.6)];
    fullScreenBGView.alpha = 0;
    [self.view addSubview:fullScreenBGView];

    viewToShowInFullScreen =  viewToShow;
    viewToShowInFullScreen.originalRect = viewToShowInFullScreen.frame;
    viewToShowInFullScreen.isFullScreen = TRUE;
    FullScreenView* fullView = [[FullScreenView alloc] initWithModel:model];
    fullView.frame = viewToShowInFullScreen.frame;
    fullView.viewToOverLap = viewToShowInFullScreen;
    fullView.fullScreenBG = fullScreenBGView;
    fullScreenView = fullView;

    [self.view addSubview:fullView];

    [self.view bringSubviewToFront:fullScreenBGView];
    [self.view bringSubviewToFront:fullView];

    [UIView beginAnimations:@"SHOWFULLSCREEN" context:NULL];
    [UIView setAnimationDuration:0.40];
    [UIView setAnimationTransition:UIViewAnimationTransitionNone forView:nil cache:NO];
    fullScreenBGView.alpha = 1;
    if (self.interfaceOrientation == UIInterfaceOrientationPortrait || self.interfaceOrientation == UIInterfaceOrientationPortraitUpsideDown) {
        [fullView setFrame:CGRectMake(10, 50, 768-20, 1004-60)];
    }else {
        [fullView setFrame:CGRectMake(10, 50, 1024-20, 746-60)];
    }
    [fullScreenView rotate:self.interfaceOrientation animation:YES];
    [UIView setAnimationDelegate:self];
    [UIView   setAnimationDidStopSelector:@selector(animationEnd:finished:context:)];
    [UIView commitAnimations];

}


 }

showViewInFullScreen通过点击屏幕的特定区域以显示全屏视图来达到方法,但是当达到时[self.view addSubview:flipper];它会返回viewDidload方法,因此无法在此方法中运行整个代码。根据行为它不应该去这个方法。为什么我无法添加subview它。对[self.view addsubView]行为进行了很多搜索。它应该添加subview到当前窗口。真的没有得到发生的事情。如果有人能建议这里出了什么问题,将不胜感激..

4

0 回答 0