| 注册
请输入搜索内容

热门搜索

Java Linux MySQL PHP JavaScript Hibernate jQuery Nginx
jopen
9年前发布

一个简单的iOS数字输入键盘:MMNumberKeyboard

MMNumberKeyboard

A simple keyboard to use with numbers and, optionally, a decimal point.

And it works great on the iPad too

Installation

From Cocoapods

CocoaPods is a dependency manager for Objective-C, which automates and simplifies the process of using 3rd-party libraries like MMNumberKeyboard in your projects. First, add the following line to your Podfile:

pod 'MMNumberKeyboard'

Second, install MMNumberKeyboard into your project:

pod install

Usage

There is a sample Xcode project available. Just build & run. And profit.

Basically you instantiate your own keyboard view to use as an .inputView of your UITextField, UITextView or whatever view that supports text editing.

// Create and configure the keyboard.  MMNumberKeyboard *keyboard = [[MMNumberKeyboard alloc] initWithFrame:CGRectZero];  keyboard.allowsDecimalPoint = YES;  keyboard.delegate = self;    // Configure an example UITextField.  UITextField *textField = [[UITextField alloc] initWithFrame:CGRectZero];  textField.inputView = keyboard;

You can adopt the MMNumberKeyboardDelegate protocol to handle the return key or whether text should be inserted or not.

Development

Pull requests are welcome and mostly appreciated.

Credits

Thanks to Pedro Burón for the encouragement and moral support to make this README file possible.


项目地址: https://github.com/matmartinez/MMNumberKeyboard

 本文由用户 jopen 自行上传分享,仅供网友学习交流。所有权归原作者,若您的权利被侵害,请联系管理员。
 转载本站原创文章,请注明出处,并保留原始链接、图片水印。
 本站是一个以用户分享为主的开源技术平台,欢迎各类分享!
 本文地址:https://www.open-open.com/lib/view/open1453537682417.html
Objective-C开发 optionally a decimal point.