Closed shadzik closed 2 years ago
Got it partially working through the defaultTextAttributes
property:
let font = UIFont.systemFont(ofSize: 33, weight: .heavy)
let paragraphStyle = NSMutableParagraphStyle()
paragraphStyle.alignment = .center
let attributes: [NSAttributedString.Key: Any] = [
.font: font,
.foregroundColor: UIColor.white,
.paragraphStyle: paragraphStyle
]
autocompleteManager.defaultTextAttributes = attributes
But paragraphStyle is stil wrong and is private. So maybe i'll create a PR that adds the possibility to pass your own paragraph style
Ok, for those who are interested:
autocompleteManager.paragraphStyle.alignment = .center
Did the trick for me
Hey,
is it possible to show autocomplete suggestions from a custom textView, not the inputTextView, without the autocomplete manager changing the style of the textView?
My code looks like this:
But when typing @ or # the style of the font configured in
self.textView
changes i.e. the font gets smaller, text alignment changes to left etc.Would be great if the textView style wouldn't change.
Thanks for your suggestions!