简体   繁体   English

页面视图控制器显示添加子视图后的上一个视图控制器

[英]Page View Controller showing previous view controller after adding subviews

I have only one view controller with collection view in page view controller and having search button on the navigation bar when i click on search bar and did search then the result is shown properly means child view controller is updating but when i slide it on left it also showing me the original content of collection view also. 我只有一个视图控制器具有页面视图控制器中的集合视图,并且当我单击搜索栏并进行搜索时导航栏上具有搜索按钮,然后结果显示正确,这意味着子视图控制器正在更新,但是当我向左滑动它时还向我展示了收藏视图的原始内容。 how can i remove that previous view controller and show only result child view controller. 我怎么能删除以前的视图控制器,并只显示结果子视图控制器。

Then you dont want a page view controller, A pageview controller will reuse the single child view controller each time the swipe is detected. 然后,您不希望使用页面视图控制器,每次检测到滑动时,页面视图控制器将重用单个子视图控制器。 In your page view controller delegate methods properly check the values from which it is being loaded is the array being reduced permanently or are u using a mutable copy of the array each time you reload the page view controller contents. 在页面视图控制器委托方法中,每次重新加载页面视图控制器内容时,都应正确检查从中加载值的值是否是永久减少的数组或是否使用可变的数组副本。

I answered a possible solution to a similar question. 我回答了类似问题的可能解决方案。 Maybe it will help you. 也许会对您有帮助。

UIPageViewController keeping previous ViewController on the Background of the view UIPageViewController将先前的ViewController保留在视图的背景上

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

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