IOS
共 3 篇文章
[IOS] 限制TextView文本输入字数包括限制联想词输入
项目遇到了限制字数的问题, shouldChangeTextInRange 也只能监听键盘输入。 用textView所有代理方法都无法监听中文联想词,无法准确限制字数。 不过想来使用KVC/KVO观察textview中text属性变化,应该可以解决这个问题。正好项目用到了RAC 几行代码搞定。 [mTextView.rac_textSignal subscribeNext:^(NSString* x) { if(mTextView.text.length > TEXT_MAXLENGTH){ mTextView.text = [mTextView.text substringToIndex:…
2015-09-24 15:20 · IOS
[IOS]自定义TableViewCell分割线和右剪头
UIView *line = [[UIViewalloc] init]; line.frame = CGRectMake(0, cell.frame.size.height, SCREEN_WIDTH, 1); line.backgroundColor = TABLE_CELL_LINE_COLOR; [cell.contentViewaddSubview:line]; UIImageView *arrowView=[[UIImageViewalloc] init]; arrowView.translatesAutoresizingMaskIntoConstraints=NO; arrowV…
2015-03-31 16:48 · IOS
[IOS]install cocoapods 安装报错
报错为: ERROR: Error installing cocoapods: ERROR: Failed to build gem native extension. 问题百度了一下午没有头绪,一google问题迎刃而解。 Installing new Ruby version helped me. Follow these steps rvm reinstall ruby-2.0.0-p247 --with-gcc=clang --verify-downloads 1 gem install xcodeproj gem install cocoapods I found this ans…