michaeltyson / TPKeyboardAvoiding

A drop-in universal solution for moving text fields out of the way of the keyboard in iOS
http://atastypixel.com/blog/a-drop-in-universal-solution-for-moving-text-fields-out-of-the-way-of-the-keyboard/
zlib License
5.81k stars 926 forks source link

Need method to ajutst offset whent textView or textfiled has inputAccessoryView !! #231

Open ZXSGG opened 8 years ago

ZXSGG commented 8 years ago

I have an issue when set textView a specify size ,eg.size(320, 60), and set textView.inputAccessoryView ,when user input text more than the content ,the textView will scroll but can not scroll bottom ,some text will be interrupt by the inputAccessoryView。 so it wil be appreciate ajust the content offset when the textView or textfield has set its inputAccessoryView

akerdi commented 7 years ago

too

AzamRahmat commented 5 years ago

try this. func textFieldDidEndEditing(_ textField: UITextField, reason: UITextFieldDidEndEditingReason) {

    DispatchQueue.main.asyncAfter(deadline: DispatchTime.now() + 0.1){[weak self]  in
        self?.scrollView.contentInset = UIEdgeInsetsMake(0.0, 0.0, 0.0, 0.0);
    }
}