All Projects → lifution → Fstextview

lifution / Fstextview

Licence: mit
继承于UITextView的自定义TextView, 带placeholder和可限制最大输入字符数, 已适配横竖屏切换.

Labels

Projects that are alternatives of or similar to Fstextview

Aligntextview
字体对齐的textview
Stars: ✭ 1,310 (+835.71%)
Mutual labels:  textview
Rotatingtext
A periodic text updating library
Stars: ✭ 1,558 (+1012.86%)
Mutual labels:  textview
Tytext
text asynchronous rendering by TextKit for iOS
Stars: ✭ 127 (-9.29%)
Mutual labels:  textview
Nextgrowingtextview
📝 The next in the generations of 'growing textviews' optimized for iOS 8 and above.
Stars: ✭ 1,540 (+1000%)
Mutual labels:  textview
Szmentionsswift
Library to help handle mentions
Stars: ✭ 109 (-22.14%)
Mutual labels:  textview
Typewriterview
Android library for typewriter like effects
Stars: ✭ 124 (-11.43%)
Mutual labels:  textview
Leotextview
🐬A high-performance rich editor develop with swift on iOS platform, based on TextKit.
Stars: ✭ 87 (-37.86%)
Mutual labels:  textview
Textview Rich Drawable
Android TextView with rich support of compound drawables
Stars: ✭ 136 (-2.86%)
Mutual labels:  textview
Pull To Refresh
ESPullToRefresh is developed and maintained by Vincent Li. If you have any questions or issues in using ESPullToRefresh, welcome to issue. If you want to contribute to ESPullToRefresh, Please submit Pull Request, I will deal with it as soon as possible.
Stars: ✭ 1,591 (+1036.43%)
Mutual labels:  textview
Xrichtext
一个Android富文本类库,支持图文混排,支持编辑和预览,支持插入和删除图片。
Stars: ✭ 1,639 (+1070.71%)
Mutual labels:  textview
Jhform
JhForm - 自定义表单工具,更加简单,快捷的创建表单、设置页面
Stars: ✭ 108 (-22.86%)
Mutual labels:  textview
Tkkeyboardcontrol
TKKeyboardControl adds keyboard awareness and scrolling dismissal (like iMessages app) to any view with only 1 line of code for Swift.
Stars: ✭ 110 (-21.43%)
Mutual labels:  textview
Drawabletextview
自定义控件 :drawable 跟随TextView居中 The drawable follows the text centered
Stars: ✭ 124 (-11.43%)
Mutual labels:  textview
Materialbadgetextview
As the name describes, this is an Android library that you can use to show new messages badge and new features badge.
Stars: ✭ 1,331 (+850.71%)
Mutual labels:  textview
Fading Text View
A TextView that changes its content automatically every few seconds
Stars: ✭ 1,691 (+1107.86%)
Mutual labels:  textview
Tagging
A TextView that provides easy to use tagging feature for Mention or Hashtag
Stars: ✭ 91 (-35%)
Mutual labels:  textview
Android Textview Linkbuilder
Insanely easy way to define clickable links within a TextView.
Stars: ✭ 1,549 (+1006.43%)
Mutual labels:  textview
Sharpview
安卓带有尖角气泡的控件(TextView,ImageView,EditText,Layout),支持渐变色,圆角等自定义属性
Stars: ✭ 137 (-2.14%)
Mutual labels:  textview
Collapsibletextview
show or hide part of text only in a TextView
Stars: ✭ 135 (-3.57%)
Mutual labels:  textview
Readmoretextview
A Custom TextView with trim text
Stars: ✭ 1,606 (+1047.14%)
Mutual labels:  textview

FSTextView

继承于UITextView的自定义TextView, 带placeholder和可限制最大输入字符数, 已适配横竖屏切换.

支持使用CocoaPods引入, Podfile文件中添加:
pod 'FSTextView'

注: 使用CocoaPods引入的话, 纯代码创建没有任何问题, 但在Storyboard中设置时会提示 Fail to update auto layout status: Fail to load designables from path (null)解决办法是在Podfile文件中添加use_frameworks!target 'YourProjectName' do前即可, 但这个方法只能是iOS8及往后版本才行, 如果你的项目版本支持的是iOS7及之前版本的话会报错, 或者你可以找到Pod文件夹中FSTextView的源码, 删除FSTextView.h中的IB_DESIGNABLE字段(删除后就没有了Storyboard中FSTextView的相关属性即设置即显示的效果).

基本使用方法:

FSTextView *textView = [FSTextView textView];
textView.placeholder = @"这是一个继承于UITextView的带Placeholder的自定义TextView, 可以设定限制字符长度, 以Block形式回调, 简单直观 !";
// 限制输入最大字符数.
textView.maxLength = 10;
// 添加输入改变Block回调.
[textView addTextDidChangeHandler:^(FSTextView *textView) {
    // 文本改变后的相应操作.
}];
// 添加到达最大限制Block回调.
[textView addTextLengthDidMaxHandler:^(FSTextView *textView) {
    // 达到最大限制数后的相应操作.
}];

竖屏状态

竖屏状态

横屏状态

横屏状态

目前已知的小问题: (不影响使用, Xcode8.3 已修复了这个问题)

在Storyboard中设置Placeholder颜色不会在Storyboard上马上呈现, 但是其实已经修改成功的了, 运行时Placeholder的颜色会是你所设置的颜色.

Requirements

iOS 6.0 +, Xcode 7.0 +

Version

  • 1.8 :

    Fix: 因为 UIMenuController 引起的 unrecognized selector sent to instance 错误.

  • 1.4 :

Fix: 达到最大限制字符数后 Undo 行为导致crash.

  • 1.3 :

    Fix: 在 Storyboard 中设置 text 后, 字符限制没有生效和 placeholder 没有自动隐藏的问题.

    新增: 添加 canPerformAction 属性来设定 FSTextView 是否允许长按弹出UIMenuController.

  • 1.2 :

    修复 #issue5

    删除了原来重载的父类属性 textgetter 方法, 如果需要获取一个去除首尾空格和换行符的字符串则调用 formatText 即可.

    FSTextView *textView = [FSTextView textView];
    textView.formatText; // 该属性获取到的字符串为去除首尾空格和换行符的.
    
  • 1.1 :

    更换注册通知的方式, 避免影响其它的 FSTextView 实例.

License

FSTextView is available under the MIT license. See the LICENSE file for more info.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].