1
我嘗試構建一個始終處於landsscape模式的應用程序。 我做了通常的東西: plist添加了UIInterfaceOrientation/UIInterfaceOrientationLandscapeRight 旋轉界面生成器中的XIB與視圖頂部的小箭頭。iphone查看翻轉:從上到下的視圖翻轉而不是從右到左
my code for launching:
- (void)applicationDidFinishLaunching:(UIApplication *)application {
[[UIDevice currentDevice] setOrientation:UIInterfaceOrientationLandscapeRight];
FlipViewController *flip = [[FlipViewController alloc] initWithNibName:@"FlipViewController" bundle:nil];
[window addSubview:flip.view];
[window makeKeyAndVisible];
}
但是當我嘗試做一個「UIViewAnimationTransitionFlipFromLeft」的頁面從頂部翻到底部,而不是從右到左。 : -/
這是我使用翻轉的意見代碼:
[UIView beginAnimations:@"View Flip" context:nil];
[UIView setAnimationDuration:1.25];
[UIView setAnimationCurve:UIViewAnimationCurveEaseInOut];
UIViewController *coming = nil;
UIViewController *going = nil;
UIViewAnimationTransition transition;
if (self.blueViewController.view.superview == nil)
{
coming = blueViewController;
going = yellowViewController;
transition = UIViewAnimationTransitionFlipFromLeft;
}
else
{
coming = yellowViewController;
going = blueViewController;
transition = UIViewAnimationTransitionFlipFromRight;
}
[UIView setAnimationTransition: transition forView:self.view cache:YES];
[coming viewWillAppear:YES];
[going viewWillDisappear:YES];
[going.view removeFromSuperview];
[self.view insertSubview: coming.view atIndex:0];
[going viewDidDisappear:YES];
[coming viewDidAppear:YES];
[UIView commitAnimations];
「窗口」似乎已經錯過了一個事實,即它是在landsscape模式。嗯。 任何人都可以發現我的錯誤嗎?
ups。然後我想到了更復雜的方法。 使用無證「oglFlip」很可能會拒絕讓我的應用進入apstore? – Sebastian 2010-02-28 17:16:19
@塞巴斯蒂安:極有可能。 – kennytm 2010-02-28 17:33:51