LoginSignup
0
0

More than 5 years have passed since last update.

UITextView Scrolling Enabled = NOのときに想定した行数分テキストが表示されない

Posted at

UITextViewを2行分の高さ (今回はheight = 40)にして、表示を確認した時にテキストが1行分しか表示されなかったので少し調べてみました。

こういうこと
uitextview.jpg

UITextViewにはデフォルトで上下に余白が設定されていて、Scrolling EnabledをNoに設定すると行が切れてしまうことになります。

なのですべて表示させたい場合は、UITextView.textContaineerInsetsを調整するか、表示フォントサイズ * 行数 + 20などして、下部Inset分足してあげる必要がありました。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0