开发者

how to disable userinteractionenable of uitextview without hiding the keyboard

i use uitextview to show some text, but i have use some animation 开发者_如何学Gotoo. During this animation appear I want to disable the keyboard but not hide it. I tried to use self.textview.userInteractionEnabled = NO;, self.textview.editable = NO;, and also [self.textview resignFirstResponder]; but it still make the keyboard hide, and also make my animation didn't show the right animation.

Can somebody give me suggestion? Thank You


Declare (BOOL)isAnimating and set it to YES when the animation begins and set it to NO when the animation end. Then implement the following:

- (BOOL)textField:(UITextField *)textField 
shouldChangeCharactersInRange:(NSRange)range 
replacementString:(NSString *)string
{
    return !isAnimating;
}   

The keyboard stays up and nothing happens in the textfield when the animation is running. After it ends, everything goes back to normal.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜