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
15
votes
6 answers

UITextView insert text in the textview text

I want to have to occasionally insert text into the UITextView text object. For example, if the user presses the "New Paragraph" button I would like to insert a double newline instead of just the standard single newline. How can I go about such? Do…
John Smith
  • 12,491
  • 18
  • 65
  • 111
15
votes
4 answers

How to pass touch from a UITextView to a UITableViewCell

I have a UITextView in a custom UITableViewCell. The textview works properly (scrolls, shows text, etc.) but I need the users to be able to tap the table cell and go to another screen. Right now, if you tap the edges of the table cell (i.e. outside…
Martin
  • 1,570
  • 3
  • 19
  • 32
15
votes
16 answers

Resize font size to fill UITextView?

How would I set the font size of text in a UITextView such that it fills the entire UITextView? I'd like the user to type in their text, then have the text fill the entire UITextView. Any help is appreciated!
Johnny Tee
  • 191
  • 1
  • 1
  • 4
15
votes
4 answers

UITextView content size different in iOS7

I am using an UITextView that will be expandable by taping a "more" button. The problem is the following: On iOS6 I use this, self.DescriptionTextView.text = @"loong…
user1028028
  • 6,323
  • 9
  • 34
  • 59
15
votes
5 answers

How to resize UITextView while typing inside it?

I'm creating a comment section much like the one Facebook uses for it's messaging section in it's iOS app. I want the UITextView to resize the height so the text I'm typing fits inside it rather than you having to scroll to see the text that…
Ollie177
  • 315
  • 1
  • 3
  • 17
15
votes
3 answers

How to open UITextView web links in a UIWebView instead of Safari?

I'm developing and iPhone 3.0 application. And I'm trying to open web links in a UITextView into a UIWebView instead of Safari. But still no luck. The UITextView is not editable, and it perfectly detects web links and open them in Safari. How to…
lucadb
  • 422
  • 1
  • 6
  • 15
15
votes
1 answer

How to detect user is mid-way inputting with an Input Method?

If user is inputting in a UITextView using an Input Method such as Chinese Pinyin, there is a state where the Pinyin is already displayed in tne text view but user is still yet to choose the final Chinese characters. A screenshot will be much more…
an0
  • 17,191
  • 12
  • 86
  • 136
15
votes
4 answers

How to find position or get rect of any word in textview and place buttons over that?

I am working on a story app.Where We need to provide quizes. Now I am having a story and there are some blanks or hidden words over that story. Whenever I click over that hidden word,I will get the 4 options to answer that. I tried by placing button…
Sabby
  • 2,586
  • 2
  • 27
  • 41
14
votes
3 answers

How do I deselect text in UITextView?

After some moment I need deselect text in UITextView. How do I deselect text in UITextView? EDIT: I need to do programmatically.
Voloda2
  • 12,359
  • 18
  • 80
  • 130
14
votes
2 answers

How to disable keyboard on a UITextView?

I have used a Text view in my app for iPad on xib. I wrote some text on it. Now while the app is running and the user is reading that text, if he accidentally touches the screen a keyboard appear. I want to disable that keyboard popping out. How…
Prateek Chaubey
  • 653
  • 2
  • 10
  • 24
14
votes
1 answer

Bullet list and Numbered list in UITextView

Can any body tell me how to add bullet list and numbered list to the selected text in UITextView.
Prerna chavan
  • 3,179
  • 7
  • 35
  • 77
14
votes
3 answers

How to create a UITextView that automatically wraps lines of text?

I am creating an app that creates a UITextView programmatically. The problem is, when the user types in text or the app sets the text, the words spread across one line and off the screen, rather than wrapping to the next line. When I create a…
Greg
  • 323
  • 1
  • 3
  • 9
14
votes
2 answers

Returning false in shouldChangeTextInRange method auto capitalize all letters

I am seeing a strange issue with UITextView in latest iOS versions. As per my current understanding, it is only occurring in iOS 13.  One of my users reported this on iOS 12.4.1, though I am unable to reproduce this on any pre iOS 13 devices. I have…
Krishnabhadra
  • 34,169
  • 30
  • 118
  • 167
14
votes
1 answer

UIMenuController Custom Items

I have created a UIMenuController and have set it a custom menu item like so: UIMenuController *menuController = [UIMenuController sharedMenuController]; UIMenuItem *item1 = [[UIMenuItem alloc] initWithTitle:@"Do This"…
Joshua
  • 15,200
  • 21
  • 100
  • 172
14
votes
2 answers

Control spacing around custom text attributes in NSLayoutManager

I’ve got a custom NSLayoutManager subclass I’m using to draw pill-shaped tokens. I draw these tokens for substrings with a custom attribute (TokenAttribute). I can draw no problem. However, I need to add a little bit of “padding” around the ranges…
jbrennan
  • 11,943
  • 14
  • 73
  • 115