Views outside the scroll area are pushed up and overlaid by navigation
Chưa có ai nhận issue này.
- #2139 của @copilot-swe-agent — đã đóng, không merge
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 42/100
Hướng nghiên cứu
Start with the provided demo project and reproduce the issue in Xcode on the iPhone 15 simulator by focusing input 0, scrolling, and pressing Return. Trace the IQKeyboardManager adjustPosition() path using the supplied log, especially the contentOffset and root-view movement calculations. Done means the focused input is visible without pushing the fixed view under the navigation bar.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Describe the bug
When I pressed return on the keyboard to next to the next input, IQKeyboardManagerSwift miscalculated and pushed my header view to the top and was covered by the navigation bar.
To Reproduce
Steps to reproduce the behavior:
- Focus input 0
- Scroll down
- Enter key return in keyboard
- See error view fixed pushed
Expected behavior
I want the scroll area to automatically scroll to the area where the input is focused.
Screenshots/Videos
[Screenshoot]
[Video]
https://github.com/user-attachments/assets/d54c92bd-7e21-4c1e-8f6a-97b2bf3e417b
Demo Project
As in the video reproducing my error, there is only 1 fixed view, 1 scrollview containing inputs, pressing the return key on this input will focus on the next input.
Versions
Xcode: 16.2
Mac OS: 14.7.5
Simulator/Device: Simulator
Simulator/Device Name: iPhone 15
Library Version: 6.5.0 (Lasted in 22/06/2025)
Additional context
My screen must have a view outside the scroll for it to be fixed.
I am assuming the height of the scrollview = 1000px, the height of the fixed view = 100px
[LOG IQKeyboardManagerSwift]
IQKeyboardManager| >>>>> adjustPosition() started >>>>>
IQKeyboardManager| | Need to move: -899.0, will be moving down
IQKeyboardManager| | old contentOffset: (0.0, 680.6666666666666)
new contentOffset: (0.0, 10.0)
IQKeyboardManager| | Remaining Move: 100.0
IQKeyboardManager| | Moving Upward
IQKeyboardManager| | Set ViewController origin to: (0.0, -100.0)
IQKeyboardManager| <<<<< adjustPosition() ended <<<<<
According to the log, your IQKM calculates when pressing enter on the keyboard when the scroll is at the end => it needs to move up 899 units, but the offset it is currently at is 680.666 and cannot scroll up 899 units => it pushed my rootview up a segment equal to the distance from the scrollView to the navigation bar
It is absurd that I can scroll down but it says it cannot scroll up and must push the rootview.
In my opinion, it only needs to scroll up a segment equal to 680.666 to be able to display the input that is focused, maybe your calculation of the scroll distance is wrong somewhere, I am not sure about this.
Thank you for reading.
- Ngôn ngữ chính
- Swift
- Star
- 16.6k
- Fork
- 2.4k
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của hackiftekhar/IQKeyboardManager
-
Xcode 27 UpdateĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
hackiftekhar/IQKeyboardManager#2184 ·
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 65/100
hackiftekhar/IQKeyboardManager#2182 ·
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
hackiftekhar/IQKeyboardManager#2181 ·
-
Root view does not fully move down when switching from a taller keyboard to a shorter keyboardĐang mở
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 68/100
hackiftekhar/IQKeyboardManager#2180 · 1 bình luận ·
-
UI OptimizationĐang mở
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 38/100
hackiftekhar/IQKeyboardManager#2178 · 1 bình luận ·
Tất cả issue của hackiftekhar/IQKeyboardManager
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
mozilla-mobile/firefox-ios#35996 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 78/100
wultra/ssl-pinning-ios#60 ·
-
fix: pre-push hook이 worktree에서 GIT_DIR을 상속해 SwiftPM 패키지 해석에 실패Có thể đã có người làm @zaehorang đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
-
Độ khó 2/5 Dưới một giờ Mức phù hợp với người mới 85/100
pluk-inc/markdown-preview#493 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Reading an empty file leaks a 4 KB buffer on Linux (Data(contentsOf:), String(contentsOfFile:))Có thể đã có người làm Có pull request liên kết đang mở hoặc đã được merge. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
swiftlang/swift-foundation#2304 ·
Maintainer thường phản hồi trong vòng 1 ngày