0

我在顶部有一个导航栏,在底部有一个标签栏。然后我在导航栏上放置了一个信息灯按钮。我的任务是按信息按钮将中间区域切换到另一个视图并保持导航栏和标签栏静止不动。

-(IBAction) infoButtonPressed:(id)sender
{
BMIInfo *infoView = [[BMIInfo alloc] initWithNibName:nil bundle:[NSBundle mainBundle]];

infoView.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal;
[self.navigationController pushViewController:infoView animated:YES];
[infoView release];

}

使用上面的这段代码,我只像翻译移动一样进行视图切换。我希望有一个翻转动作。我能怎么做?

- (IBAction)infoButtonPressed:(id)sender;
{
BMIInfo *infoView = [[BMIInfo alloc] initWithNibName:nil bundle:nil];

infoView.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal;
[self presentModalViewController:infoView animated:YES];

[infoView release];
}

有了这个,我以翻转方式切换屏幕,但它切换了整个屏幕。我希望标签栏保持静止。我也不想要标签栏开关。

4

2 回答 2

0

目前尚不清楚您要完成什么。

如果你想要一个模态视图,那么你应该使用类似的东西

[self presentModalViewController:navController animated:YES];

这样,除非您将其关闭,否则您之前的屏幕将以相同的方式保留。如果您打算在模态视图中拥有导航和选项卡栏,则将该视图声明为 TabBarController,并且您可以模态地为其提供一个导航栏。

UINavigationController *navController = [[UINavigationController alloc] initWithRootViewController:infoView];

navController.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal;
[self presentModalViewController:navController animated:YES];
于 2011-07-28T04:15:12.660 回答
0

像这样的东西”

-(IBAction) infoButtonPressed:(id)sender
{
BMIInfo *infoView = [[BMIInfo alloc] initWithNibName:nil bundle:[NSBundle mainBundle]];


[UIView animateWithDuration:1 delay:0 options:UIViewAnimationOptionTransitionFlipFromLeft animations:^(void) {
    [self.navigationController pushViewController:infoView animated:NO];
     [infoView release];
} completion:^(BOOL finished) {

}];




}
于 2011-07-28T04:15:56.390 回答