lifution / fstextview Goto Github PK
View Code? Open in Web Editor NEWCustom TextView inherited from UITextView, with placeholder and maximum input characters limit.
License: MIT License
Custom TextView inherited from UITextView, with placeholder and maximum input characters limit.
License: MIT License
比如我限制输入的是20个字符,输入20个字符之后我第一次输入空格键,会超出限制输入不会回退,相当于我输入到了21长度的位置,这个时候我再输入空格的话会回退到20字符的地方,我继续从20字符的位置输入空格之后就完全失效了。这个期间手动回退到20字符以内限制就会重新生效
不知道有中文联想、英文,表情,之类的处理吗
比如在demo中设定50个字的限定,复制150多个字进去就会出现这种问题,滚动范围有为题,只能显示一行文字,可以复制下面这段文字试验下
这是一个继承于UITextView的带Placeholder的自定义TextView, 可以设定限制字符长度, 以Block形式回调, 简单直观 !这是一个继承于UITextView的带Placeholder的自定义TextView, 可以设定限制字符长度, 以Block形式回调, 简单直观 ! 这是一个继承于UITextView的带Placeholder的自定义TextView, 可以设定限制字符长度, 以Block形式回调, 简单直观 !这是一个继承于UITextView的带Placeholder的自定义TextView, 可以设定限制字符长度, 以Block形式回调, 简单直观 !
FSTextView创建时候控制台会报约束警告,要加一下约束的优先级;
表情符号截取会有点问题 可以优化一下
期待field的作品,项目里试用FSTextView,有问题第一时间提交issue
我们项目在release模式下,textview无法使用,无法触发弹出键盘, 但是debug模式可以
![image](https://user-images.githu
busercontent.com/18735195/34929437-d270422a-f9fe-11e7-9a9e-43b24662644b.png)
代码:
(void)viewDidLoad {
[super viewDidLoad];
self.navigationItem.title = @"发布";
self.view.backgroundColor = [UIColor whiteColor];
[self.view addSubview:self.contentTextView];
}
(FSTextView *)contentTextView{
if (_contentTextView == nil) {
_contentTextView = [FSTextView textView];
_contentTextView.placeholder = @"沿路的风景...";
_contentTextView.layer.masksToBounds = YES;
_contentTextView.layer.cornerRadius = 3;
_contentTextView.layer.borderColor = RGB(235, 235, 238).CGColor;
_contentTextView.layer.borderWidth = 1.0f;
}
return _contentTextView;
}
(void)viewWillLayoutSubviews{
[super viewWillLayoutSubviews];
self.contentTextView.frame = CGRectMake(20, 84, self.view.bounds.size.width - 40, 150);
}
长按后弹出的UIMenuController,点击删除会闪退,因为没有实现delete方法
最好能有放在cell里面的案例
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.