UIsplitviewcontroller 的后退按钮未正确响应

发布于 2024-12-22 00:12:54 字数 804 浏览 3 评论 0原文

我正在创建一个应用程序,其中显示第一个主视图,其中有 6 个按钮。任何按钮选项卡都会导航到另一个视图控制器,我在其中以编程方式添加了分割视图控制器。在分割视图控制器的右视图控制器中包含带有自定义后退按钮的导航栏。当我按下后退按钮时,它必须导航到主视图控制器。但它不能正常工作。

split view based image

我使用的后退按钮代码是

-(void)backBtnTap:(id)sender

{
[[self tabBarController] setSelectedIndex:0];
[self.navigationController popToRootViewControllerAnimated:YES];
[(AppDelegate*)[[UIApplication sharedApplication] 委托] backLoadData];
}

在 AppDelegate 方法中

-(void)backLoadData

{

[self.tabBarController.view removeFromSuperview];
[self.window reloadInputViews];
[self.window addSubview:self.tabBarController.view];

}

请帮我找到这样的解决方案

提前谢谢

I am creating an app in which it shows first master view with 6 buttons are present. any of button tab it navigate to another view controller in which i have added a split view controller programmatically. In the split view controller's right view controller contain navigation bar with custom back button. when i press the back button it must be navigate to master view controller. but it is not working currectly.

split view based image

i have used the code for back button is

-(void)backBtnTap:(id)sender

{
[[self tabBarController] setSelectedIndex:0];
[self.navigationController popToRootViewControllerAnimated:YES];
[(AppDelegate*)[[UIApplication sharedApplication] delegate] backLoadData];
}

In the AppDelegate Method

-(void)backLoadData

{

[self.tabBarController.view removeFromSuperview];
[self.window reloadInputViews];
[self.window addSubview:self.tabBarController.view];

}

Please help me to find such a solution

Thanx in Advance

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(1

无妨# 2024-12-29 00:12:54

解决方案:终于我找到了解决方案。我在窗口中添加了根视图控制器,它工作得很好。

Solution: finally i have founded solution. I added the root view controller in my window in it's work perfectly.

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