본문 바로가기
프로그래밍 놀이터/iOS

[ios] UITextView dynamic height change

by 돼지왕 왕돼지 2017. 12. 20.
반응형

 [ios] UITextView dynamic height change


dynamic height change, scroll enabled, setscrollenabled, sizethatfits, UITextView, XIB, [ios] UITextView dynamic height change


-

disable scroll enabled

 

1. at XIB by Scrolling Enabled

2. at code by [UITextVIew setScrollEnabled:NO]



-

after setting text or at text change event,

CGSize newHeight = [UITextView sizeThatFits:CGSizeMake(UITextView.frame.size.width, MAXFLOAT)];

// do something with the newHeight.height;

// maybe arrange constraint of the UITextField 




반응형

댓글