美文网首页
UITableView滚动时键盘消失

UITableView滚动时键盘消失

作者: Demonboy | 来源:发表于2017-06-15 15:41 被阅读16次

    当使用UIScrollView和其子类UITableView、UITextView之类的时候,可以简单的设置ScrollView的属性keyboardDismissMode,最低支持iOS7

    typedef NS_ENUM(NSInteger, UIScrollViewKeyboardDismissMode) {
        UIScrollViewKeyboardDismissModeNone,
        UIScrollViewKeyboardDismissModeOnDrag,      // dismisses the keyboard when a drag begins
        UIScrollViewKeyboardDismissModeInteractive, // the keyboard follows the dragging touch off screen, and may be pulled upward again to cancel the dismiss
    } NS_ENUM_AVAILABLE_IOS(7_0);
    

    UIScrollViewKeyboardDismissModeOnDrag
    ScrollView拖动的时候消失
    UIScrollViewKeyboardDismissModeInteractive
    交互式效果,拖动ScrollView可以使键盘移出屏幕范围,可取

    相关文章

      网友评论

          本文标题:UITableView滚动时键盘消失

          本文链接:https://www.haomeiwen.com/subject/euquqxtx.html