ios - 如何为 UINavigationController 启用全屏平移
<p><p>从 iOS7 开始,苹果提供了一种平移 UINavigationController 的方法,但只能通过从屏幕边缘滑动来完成。如何启用全屏平移后退手势?</p></p>
<br><hr><h1><strong>Best Answer-推荐答案</ strong></h1><br>
<p><p>我真的花了很多时间试图解决这个问题,最后我找到了方法。我只是提出一个问题并自己回答以在这里分享解决方案。</p>
<p>请引用我的博客以获取更多详细信息<a href="http://liudanyun.com/blog/?p=452" rel="noreferrer noopener nofollow">enter link description here</a> </p>
<p>演示代码:</p>
<pre><code>#import "TestNavigationController.h"
@interface _UINavigationInteractiveTransition
@end
@interface UINavigationController(Custom)
@property (strong, nonatomic) _UINavigationInteractiveTransition * _cachedInteractionController;
@end
@implementation TestNavigationController
{
UIPanGestureRecognizer *_p;
}
- (void)viewDidLoad {
;
NSLog(@"%@", self.interactivePopGestureRecognizer
);
_p = [initWithTarget:self._cachedInteractionController action:@selector(handleNavigationTransition:)];
NSLog(@"%@", self._cachedInteractionController);
;
}
@end
</code></pre>
<p><strong>编辑说明:</strong>
这会暴露私有(private) API。</p></p>
<p style="font-size: 20px;">关于ios - 如何为 UINavigationController 启用全屏平移,我们在Stack Overflow上找到一个类似的问题:
<a href="https://stackoverflow.com/questions/35427451/" rel="noreferrer noopener nofollow" style="color: red;">
https://stackoverflow.com/questions/35427451/
</a>
</p>
页:
[1]