WCTextView 1.0.1

WCTextView 1.0.1

测试已测试
语言语言 Obj-CObjective C
许可证 MIT
发布上次发布2017年11月

wangchao维护。



  • 作者
  • wangchao

WCTextView

build License Pod platform support Travis 

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

演示:

WCTextView效果演示

WCTextView演示

安装

CocoaPods

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

手动安装

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

用法

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;

许可证

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