UINavigationController中的UISegmentedControl:在segue上保持相同的位置

问题描述 投票:0回答:1

我想在UINavigationController的UINavigationBar中/下方有一个UISegmentedControl,它在segue的情况下保持相同的位置。这与Safari(iOS)中的书签菜单效果相同:

Safari Bookmarks Menu

使用these answers中描述的方法(类似于this explanation),我能够在UINavigationController的UINavigationBar下方的工具栏中显示UISegmentedControl,但是如果UINavigationController推送新的UIViewController,则工具栏和它包含的UISegmentedControl将被推迟 - 屏幕。

如果UINavigationController推送新的UIViewController,强制UISegmentedControl保持在同一位置的解决方案是什么?

更新8月29日:我也尝试了this CocoaCasts tutorial,但是没有提供所需的解决方案,因为我需要一个带有常规推送动画和后退按钮的UINavigationController(比如在Safari书签菜单中),另外还有一个UISegmentedControl,当它保持在同一个位置时UINavigationController推送一个新的UIViewController(由于UISegmentedControl上的触摸而没有触发推送,但是,例如,由于触摸了UINavigationController的rootviewcontroller上的UITableView单元)。

ios swift uinavigationcontroller uisegmentedcontrol
1个回答
0
投票

您需要使用View Controller Containment执行此操作。请关注这个link

© www.soinside.com 2019 - 2024. All rights reserved.