-[UIKBBlurredKeyView candidateList]: unrecognized selector sent to instance 0x17

Scrollview上的輸入框無(wú)法實(shí)現(xiàn)鍵盤(pán)回收,于是引入如下代碼來(lái)解決這個(gè)問(wèn)題

- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event {
    [[self nextResponder] touchesBegan:touches withEvent:event];
    [super touchesBegan:touches withEvent:event];
}
-(void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event {
    [[self nextResponder] touchesMoved:touches withEvent:event];
    [super touchesMoved:touches withEvent:event];
}

- (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event {
    [[self nextResponder] touchesEnded:touches withEvent:event];
    [super touchesEnded:touches withEvent:event];
}

雖然解決了鍵盤(pán)回收,但是在做手寫(xiě)輸入時(shí)候,會(huì)出現(xiàn)閃退的情況,并報(bào)錯(cuò)

-[UIKBBlurredKeyView candidateList]: unrecognized selector sent to instance 0x17

(其他頁(yè)面做某些操作的時(shí)候也會(huì)出現(xiàn)問(wèn)題)
顯然出現(xiàn)這個(gè)上述方法是不可行,注銷(xiāo)該方法。經(jīng)過(guò)查找資料我尋找到一個(gè)新的方式來(lái)解決這個(gè)問(wèn)題
貼代碼

    UITapGestureRecognizer *recognizer = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(touchScrollView)];
    [recognizer setNumberOfTapsRequired:1];
    [recognizer setNumberOfTouchesRequired:1];
    [BKScrollview addGestureRecognizer:recognizer];


- (void)touchScrollView{
    UITextField * name = [topImageView viewWithTag:1];
    UITextField * phoneNum = [topImageView viewWithTag:2];
    UITextField * adress = [topImageView viewWithTag:4];
    [name endEditing:YES];
    [name resignFirstResponder];
    [phoneNum resignFirstResponder];
    [adress resignFirstResponder];
}
最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請(qǐng)結(jié)合常識(shí)與多方信息審慎甄別。
平臺(tái)聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡(jiǎn)書(shū)系信息發(fā)布平臺(tái),僅提供信息存儲(chǔ)服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容