Skip to content
New issue

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

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

Already on GitHub? # to your account

设置 edgesForExtendedLayout = UIRectEdge(rawValue: 0) 属性产生的一些已知问题 #17

Closed
l1Dan opened this issue Apr 22, 2023 · 0 comments
Labels
documentation Improvements or additions to documentation

Comments

@l1Dan
Copy link
Owner

l1Dan commented Apr 22, 2023

  1. 在 UIViewController 中设置 edgesForExtendedLayout = UIRectEdge(rawValue: 0) 属性,并且使用 IQKeyboardManager 框架的同时键盘没有收起,此时返回上级页面 NXNavigationBar 会出现错位的现象。这是 IQKeyboardManager 框架本身处理这种情况就有问题(设置 edgesForExtendedLayout = UIRectEdge(rawValue: 0) 属性,键盘没收起时返回上级页面导致界面下移的问题),NXNavigationExtension 框架内部无法处理这种情况(其实已经最大程度适配 IQKeyboardManager 框架)。

解决方法:

  • 不要设置edgesForExtendedLayout = UIRectEdge(rawValue: 0),保持 edgesForExtendedLayout 默认值即可。
  • 不使用 IQKeyboardManager 框架(或者在使用的 UIViewController 中暂时禁用 IQKeyboardManager 框架)。
  • 在 UIViewController 中不使用 UITextField/UITextView 等需要弹出键盘的控件。
  1. 在 UIViewController 中设置 edgesForExtendedLayout = UIRectEdge(rawValue: 0) 属性,并且使用 NXNavigationBar 本身或者 contentView 中添加需要用户交互的控件时,里面添加的控件将无法接受到用户事件的响应(控件展示没有问题),但是添加没有用户交互事件的控件是不受限制的,比如在 ViewController04_CustomNavigationBar 中设置 edgesForExtendedLayout = UIRectEdge(rawValue: 0) 属性时,NXNavigationBar 上面的按钮将无法点击。

解决方法:

  • 不要设置edgesForExtendedLayout = UIRectEdge(rawValue: 0),保持 edgesForExtendedLayout 默认值即可。
  • 不要在 NXNavigationBar 本身或者 contentView 中添加需要用户交互的控件。
@l1Dan l1Dan added the documentation Improvements or additions to documentation label Apr 22, 2023
@l1Dan l1Dan pinned this issue Apr 22, 2023
@l1Dan l1Dan changed the title 在 UIViewController 中设置 edgesForExtendedLayout = UIRectEdge(rawValue: 0) 属性产生的一些已知问题 设置 edgesForExtendedLayout = UIRectEdge(rawValue: 0) 属性产生的一些已知问题 Apr 22, 2023
@l1Dan l1Dan closed this as completed Apr 22, 2023
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

1 participant