Latest 1.0.1
Homepage https://github.com/MeetDay/WCTextView
License MIT
Platforms ios 8.0, requires ARC
Authors

[build]() [License]() [pod]() [platform]() [support]() Travis 

WCTextView继承自UITextView,并添加了placeholder(占位文本)的功能

演示:

WCTextView的效果演示:

WCTextView演示

Installation

CocoaPods

  1. 在Podfile中添加 pod 'WCTextView'
  2. 执行 pod installpod update
  3. 导入 #import <WCTextView/WCTextView.h>

手动安装

  1. 下载WCTextView文件夹中的内容
  2. 将WCTextView内的源代码添加(拖放)到你的工程
  3. 导入WCTextView.h

Usage

WCTextView *textView = [[WCTextView alloc] init];
textView.placeholder = @"占位文本";
......

WCTextView扩展的属性

/**
 占位字符
 */
@property(nonatomic, copy) IBInspectable NSString *placeholder;

/**
 占位字符的字体颜色
 */
@property (nonatomic, strong) IBInspectable UIColor *placeholderColor;

/**
 占位字符(富文本)
 */
@property (nonatomic, strong) NSAttributedString *placeholderAttributedText NS_AVAILABLE_IOS(6_0);

/**
 占位字符的字体大小
 */
@property(nonatomic, assign) UIFont *placeholderFont;

/**
 占位字符最多能显示多少行
 */
@property(nonatomic, assign) NSUInteger placeholderNumberOfLines;

/**
 占位字符的对齐方式
 */
@property(nonatomic, assign) NSTextAlignment placeholderTextAlignment;

/**
 占位字符换行模式(lineBreakMode)
 */
@property(nonatomic, assign) NSLineBreakMode placeholderLineBreakMode;

License

WCTextView使用MIT许可证,详情见LICENSE文件

Latest podspec

{
    "name": "WCTextView",
    "version": "1.0.1",
    "summary": "WCTextView has placeholder functional (WCTextViewu63d0u4f9bu4e86u5360u4f4du6587u672cu7684u529fu80fd)",
    "homepage": "https://github.com/MeetDay/WCTextView",
    "license": "MIT",
    "authors": {
        "wangchao": "[email protected]"
    },
    "platforms": {
        "ios": "8.0"
    },
    "source": {
        "git": "https://github.com/MeetDay/WCTextView.git",
        "tag": "1.0.1"
    },
    "source_files": "WCTextView/*.{h,m}",
    "requires_arc": true
}

Pin It on Pinterest

Share This