简体   繁体   中英

dismiss the UIKeyboardTypeDecimalPad in UIScrollView background

I am dealing with what seems to be a somewhat rudimentary problem. I am trying to dismiss a UIKeyboardTypeDecimalPad that has a UIScrollView background. I have seen some solutions that involve putting a done button where the decimal is if you have just a NumberPad. The problem is, I really need a decimal.

My next thought was to dismiss the keypad when the user touches the background, but since the background is a scroll view, I couldn't seem to connect an action to pick up a touch? One solution was to perhaps created a Custom Scroll View Controller...all of this seems a bit messy just to dismiss a keypad. Do I really have to do this?

Would it work for you if you put a UIBarButtonItem "Done" in your navigation bar? Have you explored the UITextField property inputAccessoryView ?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM