UITextView
はUITableViewCell
です。私はUITableView内のUITextViewは余分なパディングを削除します
if ([keyPath isEqualToString:@"noteTextView.text"]) {
[self setExcludedPaths];
if (self.noteTextView.text.length > 0) {
CGSize sizeThatFitsTextView = [self.noteTextView sizeThatFits:CGSizeMake(self.noteTextView.frame.size.width, MAXFLOAT)];
self.noteTextViewHeightConstraint.constant = sizeThatFitsTextView.height;
} else {
self.noteTextViewHeightConstraint.constant = 0.f;
}
}
の内側にそれの制約を設定しています。しかし、結果は私が上下に余分な画素を有する
です。私はそれを削除したい。私が何をしたか:
1)self.automaticallyAdjustsScrollViewInsets = NO;
を)私のUIViewController
2にUITextView
- (void)awakeFromNib
{
[super awakeFromNib];
self.font = [UIFont fontWithName:@"HelveticaNeue" size:16.f];
self.textColor = [UIColor noteTextColor];
self.textContainerInset = UIEdgeInsetsZero;
//self.contentMode = UIViewContentModeTop;
self.contentInset = UIEdgeInsetsMake(0, -5, 0, 0);
self.backgroundColor = [UIColor redColor];
self.scrollEnabled = NO;
}
のサブクラスでは、私はUIEdgeInsetsMake(-4, -5, 0, 0);
テキストがトップに移動しますが、一番下の余分なスペースがまだ
お願いします。