Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

关于 iOS 侧滑返回手势的交互解决方案 #2

Closed
foxsofter opened this issue Feb 20, 2021 · 0 comments
Closed

关于 iOS 侧滑返回手势的交互解决方案 #2

foxsofter opened this issue Feb 20, 2021 · 0 comments

Comments

@foxsofter
Copy link
Contributor

foxsofter commented Feb 20, 2021

flutter_thrio 默认会将所有的 Flutter 页面的 UINavigationBar 隐藏掉,这样的话,FlutterViewControllerUIScreenEdgePanGestureRecognizer 会失效,而 flutter_thrio 会内嵌 Flutter 页面,所以正好利用了这一点,让 Flutter 页面自身的侧滑返回手势生效。然后当 FlutterViewController 中只剩下一个 Flutter 页面时,需要将 FlutterViewController 的侧滑返回手势加回来,实现方式是单独加了一个 UIScreenEdgePanGestureRecognizer ,并将其 action 绑定到 handleNavigationTransition。所以如果原有工程已经使用了类似 FDFullscreenPopGesture 的第三方库的话,这里的行为是未知的。从我个人的角度,我建议将这类全屏滑动返回的交互去掉,原因如下:

  1. 苹果的交互方式已经培养了用户习惯;
  2. 很多 App 引入这类全屏滑动返回手势后,将交互方式整的不伦不类的,除非能统一将所有页面都整成全屏滑动返回,包括网页甚至第三方页面,但一般情况下这是不太可能的,当然现在像头条之类的 App 基本上都会增加全屏滑动返回,这种情况下基本上不出现左右滑动的手势的话交互还是很不错的;
  3. 全屏滑动返回并没有解决页面上存在滑动手势的时候侧滑返回不够灵敏的问题,有的人为了要让滑动手势生效而将全屏滑动返回禁用,附带的可能把侧滑返回也禁用了,有的人直接不管,导致滑动手势失效,一般这时候用户只能通过点击tab来完成该功能,不管何种方式,都会导致交互更垃圾,让用户不知所措;
  4. 关于侧滑返回不够灵敏的问题的可能的解决方案也许是将划入的角度从 0° 改成 +10°/-10°,这样应该会比较容易触发侧滑返回;
  5. 关于网页的手势问题,实际上在iOS上是可以通过引入多容器页来解决的,这样可以让交互跟原生页面完全一样

基于这些原因,引入 flutter_thrio 的时候遇到手势的问题,我能提供的方案是去掉原来的这类改造方案,flutter_thrio 本身只会对 FlutterViewController 进行改造,不影响原生页面。

@foxsofter foxsofter pinned this issue Feb 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant