커뮤니티 글 - 줄 간격 0 -> 8 로 변경

This commit is contained in:
Yu Sung
2024-01-19 16:16:26 +09:00
parent 5437cb07aa
commit 9c049550af

View File

@@ -15,6 +15,13 @@ struct DetectableTextView: UIViewRepresentable {
func makeUIView(context: Context) -> UITextView { func makeUIView(context: Context) -> UITextView {
let textView = UITextView() let textView = UITextView()
_ = textView.layoutManager
var attributes = [NSAttributedString.Key: Any]()
let paragraphStyle: NSMutableParagraphStyle = NSMutableParagraphStyle()
paragraphStyle.lineSpacing = 8
attributes[NSAttributedString.Key.paragraphStyle] = paragraphStyle
textView.typingAttributes = attributes
textView.isEditable = false // Make it readonly textView.isEditable = false // Make it readonly
textView.backgroundColor = .clear textView.backgroundColor = .clear
textView.isScrollEnabled = true textView.isScrollEnabled = true