2016-04-12 15 views
0

私はtextContainerInsetをコメントする以下のコードを変更しようとしましたが、contentInsetは、テキストを追加するとコンテナのフレームがどのように変化するかを調べることができません。textViewの代理同じように。JSQMessagesViewControllerのtextViewのサイズを固定する

- (void)jsq_configureTextView 
{ 
    [self setTranslatesAutoresizingMaskIntoConstraints:NO]; 

    CGFloat cornerRadius = 6.0f; 

    self.backgroundColor = [UIColor whiteColor]; 
    self.layer.borderWidth = 0.5f; 
    self.layer.borderColor = [UIColor lightGrayColor].CGColor; 
    self.layer.cornerRadius = cornerRadius; 

    self.scrollIndicatorInsets = UIEdgeInsetsMake(cornerRadius, 0.0f, cornerRadius, 0.0f); 

    self.textContainerInset = UIEdgeInsetsMake(4.0f, 2.0f, 4.0f, 2.0f); 
    self.contentInset = UIEdgeInsetsMake(1.0f, 0.0f, 1.0f, 0.0f); 

    self.scrollEnabled = YES; 

    self.scrollsToTop = NO; 
    self.userInteractionEnabled = YES; 

    self.font = [UIFont systemFontOfSize:16.0f]; 
    self.textColor = [UIColor blackColor]; 
    self.textAlignment = NSTextAlignmentNatural; 

    self.contentMode = UIViewContentModeRedraw; 
    self.dataDetectorTypes = UIDataDetectorTypeNone; 
    self.keyboardAppearance = UIKeyboardAppearanceDefault; 
    self.keyboardType = UIKeyboardTypeDefault; 
    self.returnKeyType = UIReturnKeyDefault; 

    self.text = nil; 

    _placeHolder = nil; 
    _placeHolderTextColor = [UIColor lightGrayColor]; 

    [self jsq_addTextViewNotificationObservers]; 
} 
+0

あなたはJSQMessageTextViewで入力されたテキストのフォントを変更したいですか? –

+0

いいえ、textViewのサイズを変更したり、テキストを削除したりする必要はありません。また、contentView全体(左のアクセサリボタンと右の送信ボタン)は高さを増やすためにフレームを更新しません。 –

答えて

0

JSQMessagesViewControllerのinputToolbarのmaximumHeightを設定すれば十分です。

self.inputToolbar.maximumHeight = 44

関連する問題