Xcode TextView マージン(余白)の設定

ゲーム制作
スポンサーリンク

Xcode 8.3.3
Swift 3.1
TextView内のマージン(文字とボックスの間の余白)を調整したい場合。

p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; color: #000000}
span.s1 {font-variant-ligatures: no-common-ligatures}
span.s2 {font-variant-ligatures: no-common-ligatures; color: #4f8187}
span.s3 {font-variant-ligatures: no-common-ligatures; color: #703daa}
span.s4 {font-variant-ligatures: no-common-ligatures; color: #3e1e81}

textView.textContainerInset = UIEdgeInsetsMake(top: CGFloat, left: CGFloat, bottom: CGFloat, right: CGFloat)

これで上下左右の余白を設定できる。

コメント

タイトルとURLをコピーしました