keyboard not responding to resignFirstResponder

前端 未结 5 725
遥遥无期
遥遥无期 2021-01-07 00:39

Instead of showing the keyboard I want to display a popover view when a textField is selected (my code is at the bottom). If the keyboard isn\'t showing then everything wor

5条回答
  •  失恋的感觉
    2021-01-07 01:16

    So you're trying to hide the keyboard immediately after the text field is selected and display something else?

    There's two things I can think of:

    1. Give the text field some time to get it together before resigning the first responder: [textField performSelector:@selector(resignFirstResponder) withObject:nil afterDelay:0.5];

    2. Set the inputView property of the text field to nil or a UIView with a clear background color.

提交回复
热议问题