IQKeyboardManager
IQKeyboardManager copied to clipboard
safeAreaInsetsDidChange 键盘弹起和下落,这个方法都会走,但是获取的安全距离不一样呢?
上图在设置frame的时候是不是没有考虑安全距离的问题呢?
并且发现,日志是交替进行的,一次正确,一次错误
2022-07-29 16:17:26.271497+0800 NJCBDigital[73002:4008656] -[DigitalViewController viewSafeAreaInsetsDidChange] 第33行 viewSafeAreaInsetsDidChange === {48, 0, 34, 0}
2022-07-29 16:18:34.149005+0800 NJCBDigital[73002:4008656] -[DigitalViewController viewSafeAreaInsetsDidChange] 第33行 viewSafeAreaInsetsDidChange === {48, 0, 0, 0}
2022-07-29 16:19:33.923138+0800 NJCBDigital[73002:4008656] -[DigitalViewController viewSafeAreaInsetsDidChange] 第33行 viewSafeAreaInsetsDidChange === {48, 0, 34, 0}
2022-07-29 16:19:53.635249+0800 NJCBDigital[73002:4008656] -[DigitalViewController viewSafeAreaInsetsDidChange] 第33行 viewSafeAreaInsetsDidChange === {48, 0, 0, 0}
2022-07-29 16:20:15.484146+0800 NJCBDigital[73002:4008656] -[DigitalViewController viewSafeAreaInsetsDidChange] 第33行 viewSafeAreaInsetsDidChange === {48, 0, 34, 0}
2022-07-29 16:20:33.520430+0800 NJCBDigital[73002:4008656] -[DigitalViewController viewSafeAreaInsetsDidChange] 第33行 viewSafeAreaInsetsDidChange === {48, 0, 0, 0}
2022-07-29 16:20:35.907360+0800 NJCBDigital[73002:4008656] -[DigitalViewController viewSafeAreaInsetsDidChange] 第33行 viewSafeAreaInsetsDidChange === {48, 0, 34, 0}
2022-07-29 16:20:38.296343+0800 NJCBDigital[73002:4008656] -[DigitalViewController viewSafeAreaInsetsDidChange] 第33行 viewSafeAreaInsetsDidChange === {48, 0, 0, 0}
2022-07-29 16:20:40.648066+0800 NJCBDigital[73002:4008656] -[DigitalViewController viewSafeAreaInsetsDidChange] 第33行 viewSafeAreaInsetsDidChange === {48, 0, 34, 0}
2022-07-29 16:20:42.941260+0800 NJCBDigital[73002:4008656] -[DigitalViewController viewSafeAreaInsetsDidChange] 第33行 viewSafeAreaInsetsDidChange === {48, 0, 0, 0}
2022-07-29 16:20:46.722349+0800 NJCBDigital[73002:4008656] -[DigitalViewController viewSafeAreaInsetsDidChange] 第33行 viewSafeAreaInsetsDidChange === {48, 0, 34, 0}
2022-07-29 16:20:49.379749+0800 NJCBDigital[73002:4008656] -[DigitalViewController viewSafeAreaInsetsDidChange] 第33行 viewSafeAreaInsetsDidChange === {48, 0, 0, 0}
2022-07-29 16:20:52.265006+0800 NJCBDigital[73002:4008656] -[DigitalViewController viewSafeAreaInsetsDidChange] 第33行 viewSafeAreaInsetsDidChange === {48, 0, 34, 0}
2022-07-29 16:20:54.623410+0800 NJCBDigital[73002:4008656] -[DigitalViewController viewSafeAreaInsetsDidChange] 第33行 viewSafeAreaInsetsDidChange === {48, 0, 0, 0}
2022-07-29 16:20:57.171712+0800 NJCBDigital[73002:4008656] -[DigitalViewController viewSafeAreaInsetsDidChange] 第33行 viewSafeAreaInsetsDidChange === {48, 0, 34, 0}
2022-07-29 16:21:00.469426+0800 NJCBDigital[73002:4008656] -[DigitalViewController viewSafeAreaInsetsDidChange] 第33行 viewSafeAreaInsetsDidChange === {48, 0, 0, 0}
2022-07-29 16:21:02.730455+0800 NJCBDigital[73002:4008656] -[DigitalViewController viewSafeAreaInsetsDidChange] 第33行 viewSafeAreaInsetsDidChange === {48, 0, 34, 0}
2022-07-29 16:21:05.439678+0800 NJCBDigital[73002:4008656] -[DigitalViewController viewSafeAreaInsetsDidChange] 第33行 viewSafeAreaInsetsDidChange === {48, 0, 0, 0}
2022-07-29 16:21:07.790316+0800 NJCBDigital[73002:4008656] -[DigitalViewController viewSafeAreaInsetsDidChange] 第33行 viewSafeAreaInsetsDidChange === {48, 0, 34, 0}
2022-07-29 16:21:10.667367+0800 NJCBDigital[73002:4008656] -[DigitalViewController viewSafeAreaInsetsDidChange] 第33行 viewSafeAreaInsetsDidChange === {48, 0, 0, 0}
The safe area get's changed if we change the view's frame. Now with 6.5.13 the starting safe area is taken into consideration while moving the view's upward/downward.