Latest 1.0
Homepage https://github.com/Yigol2008/JNPlaceholderTextView
License MIT
Platforms ios 8.0, requires ARC
Authors

基于UITextView,增加placeholder功能,增加限制text的输入字数功能

===

如何使用:

使用CocoaPods:
platform :ios, '8.0'
pod 'JNPlaceholderTextView'
导入头文件:
#import "JNPlaceholderTextView.h"
申明变量:
@property (weak, nonatomic) IBOutlet JNPlaceholderTextView *textView;
根据需求实现对应功能:
self.textView.placeholder = @"Hello world";
self.textView.placeholderFontSize = 18.0f;
self.textView.placeholderColor = [UIColor brownColor];
self.textView.maxLimitLength = 10;
如果不需要换行输入功能,可在UITextViewDelegate中写上如下代码:
- (BOOL)textView:(UITextView *)textView shouldChangeTextInRange:(NSRange)range replacementText:(NSString *)text
{
    if () {
        [textView resignFirstResponder];
        return NO;
    }
    return YES;
}

协议(Licenses)

===

  • JNPlaceholderTextView 被许可在 MIT 协议下使用。查阅 LICENSE 文件来获得更多信息。

Latest podspec

{
    "name": "JNPlaceholderTextView",
    "version": "1.0",
    "platforms": {
        "ios": "8.0"
    },
    "license": "MIT",
    "requires_arc": true,
    "authors": {
        "Yigol2008": "[email protected]"
    },
    "summary": "u5e26placeholderu7684TextView",
    "description": "u57fau4e8eUITextViewuff0cu589eu52a0placeholderu529fu80fduff0cu589eu52a0u9650u5236textu7684u8f93u5165u5b57u6570u529fu80fd",
    "homepage": "https://github.com/Yigol2008/JNPlaceholderTextView",
    "source": {
        "git": "https://github.com/Yigol2008/JNPlaceholderTextView.git",
        "tag": "1.0"
    },
    "source_files": "JNPlaceholderTextView/*.{h,m}"
}

Pin It on Pinterest

Share This