部分 uiview 不会调用 TouchBegan 来获取 uisplitview 之上的视图

发布于 2024-09-24 01:31:43 字数 876 浏览 0 评论 0原文

我正在用 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

宫墨修音 2024-10-01 01:31:43

检查视图边界的大小。它应该和 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).

放血 2024-10-01 01:31:43

很久以前......但也许其他人需要答案。我也有同样的问题。我的错误是我用纵向模式(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).

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文