remove all uitextview padding
This commit is contained in:
@@ -27,25 +27,23 @@ class ExpoSelectableTextView: ExpoView {
|
|||||||
textView.isScrollEnabled = false
|
textView.isScrollEnabled = false
|
||||||
textView.backgroundColor = .clear
|
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
|
// Add the text view to the root view
|
||||||
addSubview(textView)
|
addSubview(textView)
|
||||||
|
|
||||||
// Configure the press recognizer
|
// 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(_:)))
|
let tapGestureRecognizer = UITapGestureRecognizer(target: self, action: #selector(callOnPress(_:)))
|
||||||
textView.addGestureRecognizer(tapGestureRecognizer)
|
textView.addGestureRecognizer(tapGestureRecognizer)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
override func layoutSubviews() -> Void {
|
||||||
|
// Set the textView's frame on layout
|
||||||
|
setSize()
|
||||||
|
}
|
||||||
|
|
||||||
@IBAction func callOnPress(_ sender: UITapGestureRecognizer) -> Void {
|
@IBAction func callOnPress(_ sender: UITapGestureRecognizer) -> Void {
|
||||||
if let segment = getPressedSegment(sender) {
|
if let segment = getPressedSegment(sender) {
|
||||||
if segment.handlePress, textView.selectedTextRange == nil {
|
if segment.handlePress, textView.selectedTextRange == nil {
|
||||||
|
|||||||
Reference in New Issue
Block a user