- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我知道有关堆栈溢出的主题有很多讨论,但没有一个问题有适合我的答案。
我有一个作为 Root View Controller 加载的 SplitViewController,并且 SVC 内的两个 TableView 都将 ShouldAutoRotate 设置为返回 YES。
即使时钟/状态栏可以,SVC 也不会随 iPad 正确旋转。
<小时/> 更新在我的 AppDelegate 中,我注意到 rootViewController 在我设置之后才真正被设置 - rootViewController 不应该总是被设置吗?这段代码:
MyAppAppDelegate *appDelegate = (MyAppAppDelegate *)[[UIApplication sharedApplication] delegate];
NSLog(@"RootViewController pre set: %@", appDelegate.window.rootViewController);
[appDelegate.window setRootViewController:splitViewController];
NSLog(@"RootViewController post set: %@", appDelegate.window.rootViewController);
记录为:
RootViewController pre set: (null)
RootViewController post set: <UISplitViewController: 0x88ad2d0>
这是否意味着我错误地认为 SVC 是 Root View Controller ?
此外,在 IB 中 - 窗口没有任何东西连接到 rootViewController 导出 - 这是一个问题吗?
这是以编程方式创建 SVC 的位置:
-(IBAction)makeStory:(id)sender{
MakeSentenceTableViewController *detailViewController = [[MakeSentenceTableViewController alloc] initWithNibName:@"MakeSentenceTableViewController" bundle:nil];
UISplitViewController *splitViewController = [[[UISplitViewController alloc] init] autorelease];
UINavigationController *rootNav = [[[UINavigationController alloc] initWithRootViewController:makeStoryTableViewController]autorelease];
UINavigationController *detailNav = [[[UINavigationController alloc] initWithRootViewController:detailViewController] autorelease];
splitViewController.viewControllers = [NSArray arrayWithObjects:rootNav, detailNav, nil];
splitViewController.delegate = makeStoryTableViewController;
MyAppAppDelegate *appDelegate = (MyAppAppDelegate *)[[UIApplication sharedApplication] delegate];
[appDelegate.window setRootViewController:splitViewController];
}
这是两个 TableView 中的 ShouldAutoRotate 部分(它们在两个 TableView 中都是相同的):
// Override to allow orientations other than the default portrait orientation.
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
// Return YES for supported orientations
if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) {
NSLog(@"story idiom for rotate is iPad");
return YES;
}
请帮助我解决这个问题,以便 SplitViewController 正确加载 - 或者帮助我使用一些调试技术(例如,我如何检查以确保 SVC 位于 rootViewController 中,是否有其他方法来调试旋转麻烦?) 。
最佳答案
啊。通常,提问过程的一部分会导致你自己回答。
我必须将 IB 中 MainWindow~ipad.xib 的 rootViewController 导出连接到 AppDelegate 中的 viewController,然后一切就开始工作了。
所以我没有正确地将 UISplitViewController 设置为 rootViewController。
关于ios - UISplitViewController 未正确旋转,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9612036/
我知道 UISplitViewController 只能用作根 Controller 。但是否可以从一个分割 View 转到另一个分割 View ? 喜欢加载具有不同数据和布局的详细 View 和主视
然后将其合并到垂直 View 中?这是来自 IMDB 应用程序的示例。 http://img39.imageshack.us/img39/5636/imdb2.jpg http://img39.ima
iOS 5.1 中与 UISplitViewController 相关的新行为应用程序似乎正在拦截 UISlider产生不良结果的运动。这可能也适用于 UISegmented控件和任何其他处理从左到右
我有一个 UISplitViewController,并尝试从 MasterViewController 获取事件并完全更改 DetailViewController。据我了解,这基本上可以通过执行以
每当用户在iPad的UIsplitView中从横向 View 切换到纵向 View 时,我都希望使弹出窗口 View 可见。虽然用户可以通过单击条形按钮使其可见,但我希望此操作对于纵向模式是自动的。
我最近遇到了一个问题。我的iPad应用程序某种程度上阻止了iPad自动旋转。我的应用程序加载了一个UISplitView,这两个 View Controller 都为shouldAutorotateT
我正在开发一个 iPadOS 应用程序,我在其中使用了 UISplitViewController。到目前为止,我一直在使用旧的 API 并手动处理所有内容(包括 displayModeButtonI
我正在尝试将 splitview Controller 添加为 subview Controller 。父 View Controller 是导航 Controller 。父 View Control
我在我的应用程序中使用 MGSplitViewController 库。直到 iOS7 都可以正常工作,但是对于 iOS8 来说,它不能按预期工作,原因是iOS8中 UIPopoverControll
我有一个根 UISplitViewController,其中包含与 DetailViewController 相关的 UINavigationController。 DetailViewControl
我在让 UISplitViewController 在通用应用程序中工作时遇到问题,我已经对 iPhone 部分进行了编码。作为一种故障排除方法,我决定从一个新项目开始,并尝试执行导致问题的一个操作,
我想在纵向模式下创建一个 UISplitViewController,就像在“设置”应用程序中一样。我该怎么做? 最佳答案 有点晚了,还看一下MGSplitViewController作者:马特·格梅
如何在横向模式下隐藏splitviewcontroller的detailView中的导航Bar? 在详细 View 中,我尝试过这样 self.navigationController.navigat
在我的 iPad 应用程序中,我使用带有两个 UINavigationControllers 作为主控和细节的 UISplitViewController。在 Potrait 中,我希望通过 UIPo
在我的 iPad 应用程序中。我正在处理 UISplitViewController .在 DetailViewController的 UISplitViewController有按钮。当按下该按钮时
我想知道是否可以使用带有按钮的普通 ViewController,当您单击按钮时,它会显示一个新的 Controller ,该 Controller 分为两个带有 uisplitviewcontrol
我设置了一个非常简单的 iOS splitView Controller 项目,它有一个非常奇怪的错误。如果您以横向模式启动应用程序,请单击一个按钮以打开另一个 View ,旋转到纵向,然后返回到起始
抱歉,如果之前已经发布过此内容,我浏览了 Apple Docs 等,但找不到有关 UISplitViewController 工作原理的良好解释。 我问这个问题是因为我为 UINavigationBa
我有一个带有 SplitView 的应用程序,可让您将公司添加到数据库中。在 masterView 中,公司显示其各自的公司名称。点击其中一家公司会向我显示“viewCell”中的地址(实际上不是单元
我们正在使用 UISplitViewController。当不处于“分割模式”时显示详细 View Controller 时,屏幕顶部会出现一个灰色条。有谁知道为什么会发生这种情况。在分割 View
我是一名优秀的程序员,十分优秀!