add
This commit is contained in:
@@ -0,0 +1,61 @@
|
||||
//
|
||||
// GiGaFeedContentViewCell.m
|
||||
// GIGA
|
||||
//
|
||||
// Created by lianxiang on 2018/9/22.
|
||||
// Copyright © 2018年 com.giga.ios. All rights reserved.
|
||||
//
|
||||
|
||||
#import "GiGaFeedContentViewCell.h"
|
||||
|
||||
@implementation GiGaFeedContentViewCell
|
||||
|
||||
- (void)awakeFromNib {
|
||||
[super awakeFromNib];
|
||||
// Initialization code
|
||||
self.contentFiled.delegate =self;
|
||||
}
|
||||
|
||||
- (void)textViewDidBeginEditing:(UITextView *)textView{
|
||||
if (textView == self.contentFiled) {
|
||||
self.holdLabe.hidden = YES;
|
||||
}
|
||||
|
||||
}
|
||||
- (void)textViewDidChange:(UITextView *)textView
|
||||
{
|
||||
if (textView == self.contentFiled) {
|
||||
if (textView.text.length == 0) {
|
||||
self.holdLabe.hidden = NO;
|
||||
}
|
||||
|
||||
if ( textView.text.length <=100 ) {
|
||||
|
||||
self.numberCountLabe.text = [NSString stringWithFormat:@"%lu/100",(unsigned long)textView.text.length];
|
||||
self.contentFiled.text = textView.text;
|
||||
self.textMAx = textView.text;
|
||||
}else{
|
||||
textView.text = self.textMAx;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
- (BOOL)textView:(UITextView *)textView shouldChangeTextInRange:(NSRange)range replacementText:(NSString *)text{
|
||||
|
||||
|
||||
// if ( textView.text.length >100 ) {
|
||||
//
|
||||
// return NO;
|
||||
// }
|
||||
return YES;
|
||||
}
|
||||
|
||||
|
||||
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
|
||||
[super setSelected:selected animated:animated];
|
||||
|
||||
// Configure the view for the selected state
|
||||
}
|
||||
|
||||
@end
|
||||
Reference in New Issue
Block a user