简体   繁体   English

iOS导航控制器后退按钮引起故障

[英]iOS Navigation Controller Back Button Causing Glitch

I have a navigation view that contains a tableview. 我有一个包含tableview的导航视图。 If one of the tableview items is clicked, the navigation controller passes the user to the detail view. 如果单击了一个tableview项目,则导航控制器会将用户转到详细视图。

This usually works perfectly. 这通常可以正常工作。 However, if the user clicks the back button from the detail view and moves back and forth between the tableview and detail view too quickly, the app will sometimes become glitchy. 但是,如果用户从详细视图单击后退按钮并在表视图和详细视图之间来回移动太快,则该应用有时会出现故障。

This glitch occurs rarely, but when it does, the back button makes the view transition to the left, but it just shows the detail view again. 这种故障很少发生,但是当出现这种情况时,后退按钮可使视图向左过渡,但它仅再次显示了详细视图。 Then I need to press the back button again in order to actually go back to the list view. 然后,我需要再次按“后退”按钮才能真正返回到列表视图。

Does anyone know why this might be happening? 有谁知道为什么会这样? Or is there a bit of code I can post to help resolve this? 还是我可以发布一些代码来帮助解决此问题? Thanks! 谢谢!

Try this: 尝试这个:

//in viewwillappear
appDelegate.window.userInteractionEnabled = FALSE;
[self performSelector:@selector(userInteraction) withObject:nil afterDelay:0.5];


-(void)userInteraction
{
    appDelegate.window.userInteractionEnabled = TRUE;
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM