TPKeyboardAvodingScrollView
クラスを使用して、キーボードがUITextField
. ただし、iPhone には奇妙なバグがいくつかありますUITextField
。テキストフィールドをクリックすると、高すぎますが上がります。
GitHub リンクのノートには次のように書かれています。
ノート
これらのクラスは現在、contentInset パラメーターを調整して、コンテンツがキーボードの下に移動しないようにします。これは、フレームを調整するのではなく、安定する前にビューが上にジャンプするぎくしゃくしたアニメーションになる iOS のバグを回避するために行われます。この回避策を容易にするために、contentSize は少なくともビューのフレームと同じサイズに維持されます。
これと関係があるのかもしれませんが、どうすればこの問題を解決できるかわかりません。
私はすでにこの行を変更しようとしました:
[self setContentOffset:CGPointMake(self.contentOffset.x,
[self idealOffsetForView:firstResponder withSpace:[self keyboardRect].origin.y - self.bounds.origin.y])
あり(+100追加):
[self setContentOffset:CGPointMake(self.contentOffset.x,
[self idealOffsetForView:firstResponder withSpace:[self keyboardRect].origin.y - self.bounds.origin.y+100])
しかし、これは iPad では動作しないため、良い方法ではありません。