Questions tagged [uitextview]

The UITextView class implements the behavior for a scrollable, multiline text region in iOS. The class supports the display of text using a custom font, color, and alignment and also supports text editing. You typically use a text view to display multiple lines of text, such as when displaying the body of a large text document.

The UITextView class implements the behavior for a scrollable, multiline text region. The class supports the display of text using custom style information and also supports text editing. You typically use a text view to display multiple lines of text, such as when displaying the body of a large text document.

Before iOS 6 () the text could only be styled as a whole, since then the view supports finer grained control of the text style through the .attributedText property.

References:

UITextView Class Reference

5806 questions
2
votes
0 answers

How to convert position of UITextview to SKScene position?

I need to have more than one line of text so I cannot use SKLabelNode. I want the UITextView to be positioned in a central position of the screen no matter what device is used. Problem is the coordinate system seems to be different than the…
2
votes
1 answer

ios textView.selectedTextRange giving wrong range for textview containing Emojis

My function wants to get cursor current position in textview, but when i have string " " (cursor is at last position)in textview and it return me range (0,6) and current index as 6, expected position is 3,Please let me know if any way to get…
user3395433
  • 123
  • 2
  • 10
2
votes
2 answers

UITextView selectionRange strange behavior with plus sign "+"

If I have a plus sign in my UITextView, and I try to set the selectionRange to immediately precede it (i.e, put the cursor before the plus sign), it automatically moves to the next space. As far as I can tell, this is specifically for plus signs;…
William Jockusch
  • 26,513
  • 49
  • 182
  • 323
2
votes
2 answers

Keyboard not dismissed

I am developing a messaging application that have SMS.app-like UI. Conversation screen has text input field at the bottom which is moved up with keyboard. Tapping on conversation area dismisses keyboard by calling resignFirstResponder method on…
sgosha
  • 1,299
  • 12
  • 19
2
votes
1 answer

Why are NSAttributedString's attributes now of type [NSAttributedStringKey: Any] but UITextView's typingAttributes are still of type [String: Any]?

I used to be able to generate NSAttributedStrings and set a UITextView's typingAttributes using the same attribute dictionary (most especially the same keys) of type [String: Any]. Since iOS 11, I've had to change [String: Any] attributes to…
Aaron
  • 6,466
  • 7
  • 37
  • 75
2
votes
0 answers

Crash when calling reloadInputViews after adding custom input view

Our app uses a custom input view, added as a subview to an instance of UIInputView. We're receiving crash reports after adding this view to our UITextView's inputView property and then calling [textView reloadInputViews], but I can't reproduce the…
Antipex
  • 141
  • 1
  • 9
2
votes
1 answer

Append formatted string to already formatted string from UITextView?

How can a NSAttributedString formatted string be appended to an existing textView.attributedText formatted string from UITextView? From this answer, I can see that a conversion from and to NSMutableAttributedString / NSAttributedString can be…
powtac
  • 40,542
  • 28
  • 115
  • 170
2
votes
1 answer

Text View expand or contract upon clicking see more button

In my tableView cell, I have a textView whose string i'm getting via JSON and updating the cell height dynamically like this func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat { if indexPath.section == 0…
Usama bin Attique
  • 337
  • 1
  • 3
  • 16
2
votes
1 answer

How to entirely disable UITextView's scroll?

I'm developing a simple text editing app for iPad using UITextView. I always had some problems with UIScrollView and UITextView. I think I just expected too much things from these two. When I set myTextView.text to another a NSString instance,…
pnmn
  • 1,127
  • 1
  • 14
  • 22
2
votes
1 answer

Display copy after select text from textview using swift

Using this code it will show me : copy, select, select all and paste. But I want select and select all first when user click on select then and then copy will display and when click on copy then paste will display. class CustomTextField:…
Mili Shah
  • 1,456
  • 13
  • 21
2
votes
1 answer

Scrolling to the Bottom of a UITextView Stopped Working

How should I scroll to the bottom of a UITextView? My previous implementation, which I took from a previous post here on stackoverflow, stopped working when I updated to Swift 4. My program regularly pastes new information to a UITextView…
Beagley
  • 73
  • 1
  • 7
2
votes
1 answer

can I call a select method from UIResponderStandardEditActions?

I'm currently developing a simple text editing app for iPad using UITextView. I want to select parts of UITextView's text and highlight it with a default blue selection bar. For example, I wrote this code to select the entire document. [myTextView…
pnmn
  • 1,127
  • 1
  • 14
  • 22
2
votes
1 answer

Cannot convert value of type 'Range' to expected argument type 'UITextRange'

How to create range based on a string. With below code, I'm getting the error "Cannot convert the value of type 'Range' to expected argument type 'UITextRange'". FYI print(firstString[range]) successfully output "xxx". class ViewController:…
mclovin
  • 107
  • 10
2
votes
0 answers

Scroll UITableView up as UITextView grows in height

I have a UITableView with dynamically sized prototype cells using auto layout to fit their contents. In one of my prototype cells I have a UITextView which I have configured to dynamically change its height and become scrollable once the TextViews…
2
votes
0 answers

Vertical Text Alignment in UITextView Xamarin.ios

I want a centre aligned text in a UITextView. Just like Whatsapp Type a status page.
Hemil Modi
  • 66
  • 3
1 2 3
99
100