部分 uiview 不会调用 TouchBegan 来获取 uisplitview 之上的视图
我正在用 uisplitview 编写一个 ipad 应用程序。一旦用户点击按钮,我就会通过从堆栈中删除 uisplitview 并推送新视图来全屏显示另一个视图。我遇到的问题是新的 uiview 只能获取屏幕 3/4 的 TouchBegan 。看起来这与 uisplitview 中的 uidetailview 使用的区域相同。几天来我一直在试图解决这个问题,但没有成功。
uisplitview 被合成并添加到 didFinishLaunchingWithOptions 中,如下所示:
[window addSubview:splitViewController.view];
[窗口 makeKeyAndVisible];
然后,当用户触摸按钮时,我这样做:
NewViewController *newViewController = [NewViewController alloc];
UINavigationController *navController = [[UINavigationController alloc] initWithRootViewController:newViewController];
navController.modalPresentationStyle = UIModalPresentationFullScreen; navController.modalTransitionStyle = UIModalTransitionStyleCoverVertical;
[self.navigationController PresentModalViewController:navController 动画:YES];
[新ViewController发布];
[navController发布];
I'm writting an ipad app with a uisplitview. Once a user taps on a button, I display another view in full screen by removing the uisplitview from the stack and pushing the new view. The problem I have is that the new uiview only gets touchesBegan for 3/4 of the screen. It seems like that is the same area used up for the uidetailview in the uisplitview. I've been trying to figure this out for a few days with no luck.
the uisplitview gets synthesized and it gets added in the didFinishLaunchingWithOptions like this:
[window addSubview:splitViewController.view];
[window makeKeyAndVisible];
then, when the user touches a button, I do this:
NewViewController *newViewController = [NewViewController alloc];
UINavigationController *navController = [[UINavigationController alloc] initWithRootViewController:newViewController];
navController.modalPresentationStyle = UIModalPresentationFullScreen;
navController.modalTransitionStyle = UIModalTransitionStyleCoverVertical;
[self.navigationController presentModalViewController:navController animated:YES];
[newViewController release];
[navController release];
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
检查视图边界的大小。它应该和 iPad 屏幕一样大。即 1024x768(或 768x1024)。
Check the sizes of the bounds of the view. It should be as big as the iPad screen. That is 1024x768 (or 768x1024).
很久以前......但也许其他人需要答案。我也有同样的问题。我的错误是我用纵向模式(1024+768)初始化了 UIWindow,但这是错误的。无论您如何旋转 iPad,窗口都不会旋转,并且必须具有纵向尺寸 (768x1024)。
Long time ago... but maybe somebody else needs the answer. I had the same problem. My fault was that I initialized the UIWindow with portrait mode (1024+768) but this is wrong. The window, however you rotate the iPad, will never rotate and must have the portrait dimensions (768x1024).