remove all uitextview padding

This commit is contained in:
Hailey
2024-01-12 16:34:35 -08:00
parent 0f0b6aa131
commit b8318446a3
@@ -27,25 +27,23 @@ class ExpoSelectableTextView: ExpoView {
textView.isScrollEnabled = false
textView.backgroundColor = .clear
clipsToBounds = true
// Remove all of the padding from the view
textView.textContainerInset = UIEdgeInsets.zero
textView.textContainer.lineFragmentPadding = 0
// Add the text view to the root view
addSubview(textView)
// Configure the press recognizer
configurePressRecognizer()
}
override func layoutSubviews() {
// Set the textView's frame on layout
setSize()
}
func configurePressRecognizer() -> Void {
let tapGestureRecognizer = UITapGestureRecognizer(target: self, action: #selector(callOnPress(_:)))
textView.addGestureRecognizer(tapGestureRecognizer)
}
override func layoutSubviews() -> Void {
// Set the textView's frame on layout
setSize()
}
@IBAction func callOnPress(_ sender: UITapGestureRecognizer) -> Void {
if let segment = getPressedSegment(sender) {
if segment.handlePress, textView.selectedTextRange == nil {