首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >旋转设备时如何显示横向coverflow样式视图?

旋转设备时如何显示横向coverflow样式视图?
EN

Stack Overflow用户
提问于 2011-01-10 14:04:23
回答 1查看 783关注 0票数 3

我正在开发一个应用程序,当设备旋转到横向时,需要在横向显示coverflow样式的视图。我以前开发过一些应用程序,但它们都不需要横向/旋转,所以我没有使用经验。我有绘制coverflow视图的代码,但呈现它很困难。

我想要的基本上是iPod应用程序在显示coverflow时所做的事情。下面的视图不旋转,但覆盖流在顶部淡入,并在旋转回纵向时淡出。

我猜这与shouldAutorotateToInterfaceOrientation和使用淡入淡出过渡的模式视图有关,或者使用了这里提供的技术:

http://www.iphonedevsdk.com/forum/iphone-sdk-development/22285-replicating-cool-ipod-landscape-transition-iphone.html

我想我的主要问题是呈现了模式视图,但它的内容没有旋转到横向。我该怎么办?

下面是我现在使用的代码:

父视图

代码语言:javascript
运行
复制
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation{
NSLog(@"rotating?");
if (interfaceOrientation == UIInterfaceOrientationPortrait) {
    return YES;
}
if ((interfaceOrientation == UIInterfaceOrientationLandscapeLeft) || (interfaceOrientation == UIInterfaceOrientationLandscapeRight)) {
    NSLog(@"rotating");
    CoverFlowViewController *coverFlowView = [[CoverFlowViewController alloc] init];
    [coverFlowView setModalTransitionStyle:UIModalTransitionStyleCrossDissolve];
    [self presentModalViewController:coverFlowView animated:YES];
    [coverFlowView release];
}
return YES;

}

模式视图

代码语言:javascript
运行
复制
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
NSLog(@"rotating? going back?");
if ((interfaceOrientation == UIInterfaceOrientationLandscapeLeft) || (interfaceOrientation == UIInterfaceOrientationLandscapeRight)) {
    return YES;
} else {
    [self.parentViewController dismissModalViewControllerAnimated:YES];
}
return NO;

}

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2011-03-05 03:06:04

您应该在内部进行转换:

代码语言:javascript
运行
复制
- (void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration {

}
票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/4644130

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档