iPhone 负数键盘布局?
我的用户需要输入纬度和经度,当然我需要验证输入的值是否是合法的纬度/经度值。 我想要一个键盘布局,可以为我完成一些工作(消除字母字符、标点符号等,只留下数字和+/-)。 数字键盘似乎无法做到这一点(缺少 +/-),SDK 附带的任何其他键盘布局也无法做到这一点。 有谁知道是否有一种方法可以提供这种功能,而无需使用我自己的键盘输入法和越狱手机?
谢谢!
My users need to enter latitude and longitude, and of course I need to verify that the values entered are legitimate lat/long value. I'd like to have a keyboard layout that does some of this for me (eliminating alphabetic characters, punctuation, etc, and leaving only the numbers and +/-). The number pad keyboard doesn't seem to do it (missing +/-) and neither do any other keyboard layouts that come with the SDK. Does anyone know if there is a way to provide that capability without doing my own keyboard IME and jailbreaking the phone?
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
在 UITextView 旁边放置一个“+/-”按钮来切换输入文本的符号怎么样? 或者出现在其左侧的“+”按钮,每次点击它时,按钮标签都会从“+”切换到“-”。
How about placing a "+/-" button next to your UITextView that would switch the sign of the entered text? Or a "+" button that appears to the left of it that switches the button label from "+" to "-" each time you tap it.
你不必越狱。
如果您创建一个视图来模拟键盘,您仍然需要遵守 SDK 规则。
You don't have to jailbreak.
If you create a view to simulate the keyboard you're still following the SDK rules.
我知道这个答案已经太晚了,但这个话题仍然与我相关。 因此,我希望以下内容能够帮助浏览此页面的人。
Bryan S. Gruver 发布了一个完整的 Xcode 项目,lambdabunny 可以稍微修改该项目以实现他们的目标。 你可以在这里找到它:
http://brygruver.squarespace。 com/blog/2009/10/1/creating-a-custom-number-pad.html
更新
Squarespace 链接现已断开。 另一种选择是:
https://github.com/lnafziger/Numberpad
I know this is answer is way late, but this topic was still relevant to me. Therefore I have hope the following will help someone who comes across this page.
Bryan S. Gruver posted a full Xcode project that lambdabunny could modify ever so slightly in order to achieve their aim. You can find it here:
http://brygruver.squarespace.com/blog/2009/10/1/creating-a-custom-number-pad.html
Update
The Squarespace link is now broken. Another option is:
https://github.com/lnafziger/Numberpad