Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

Views outside the scroll area are pushed up and overlaid by navigation

Đang mở
#2,110 8 bình luận 4 reaction 0 người được giao Xem trên GitHub

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
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
swift
Lĩnh vực
mobile

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ả

Bug

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:

  1. Focus input 0
  2. Scroll down
  3. Enter key return in keyboard
  4. 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

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. 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.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của hackiftekhar/IQKeyboardManager

Tất cả issue của hackiftekhar/IQKeyboardManager

Issue tương tự

Thêm issue về Swift

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.