[英]How to scroll UITableView When Keyboard hides the bottom half section of the screen
You need to use one UITableView
and use TPKeyboardAvoidingTableView
class for your UITableView
this class automatically manages scrolling of UITextFields
inside UITableViewCells
. 您將在谷歌上獲得TPKeyboardAvoidingTableView
的示例代碼搜索。
您是否嘗試過滾動視圖...??? 此鏈接可能對您有所幫助: http://www.edumobile.org/iphone/iphone-programming-tutorials/scrollview-example-in-iphone/
請使用 IQKeyboardManager 這將自動調整足夠的滾動,您必須將此代碼放在您的 AppDelegate 中:-
import IQKeyboardManagerSwift
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
IQKeyboardManager.shared.enable = true
return true
}
stackoverflow 上有與您的問題相關的答案。 試試這個: iPhone - 鍵盤隱藏文本字段
顯示鍵盤時更改 tableview 的高度,然后當它被關閉時重置高度。 希望這能回答你的問題。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.