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
26
votes
9 answers

UITextView with clickable links but no text highlighting

I have a UITextView displaying non-editable text. I want the text to automatically parse links, phone numbers, etc for the user, and for those to be clickable. I don't want the user to be able to highlight text, though, because I want to override…
Trespassers W
  • 379
  • 1
  • 5
  • 14
26
votes
9 answers

Disable UITextField keyboard shortcut suggestions

Is there a simple way to remove keyboard shortcut suggestions from a UITextField? It is possible to remove typing correction with: [textField setAutocorrectionType:UITextAutocorrectionTypeNo]; however this as no effect on shortcuts. Affecting the…
Matt
  • 2,329
  • 1
  • 21
  • 23
26
votes
15 answers

How to make a UITextView scroll while typing/editing

UPDATE This seemed to be an issue with IOS 7 only. A great workaround has been added to accepted answer. I have created a custom control that contains a UITextView and UILabel which contains the title of the textview ie my control. My control…
chrs
  • 5,906
  • 10
  • 43
  • 74
25
votes
5 answers

iOS 7.1 UITextView still not scrolling to cursor/caret after new line

Since iOS 7, a UITextView does not scroll automatically to the cursor as the user types text that flows to a new line. This issue is well documented on SO and elsewhere. For me, the issue is still present in iOS 7.1. What am I doing wrong? I…
bilobatum
  • 8,918
  • 6
  • 36
  • 50
25
votes
5 answers

how text length of a UITextView can be fixed?

I have a UITextView, user can write maximum 160 character in the textView. How can i fixed the maximum text length of a UITextView?
faisal
  • 475
  • 2
  • 9
  • 17
25
votes
9 answers

Scroll to bottom of UITextView erratic in iOS 7

The following code will work fine in iOS < 7.0. In iOS 7 the scrolling will be choppy and erratic while the UITextView is updating. I'm not sure if this is a bug in iOS 7, or I am doing something wrong. TestController.h //TODO: Add UITextView in…
Mikt25
  • 695
  • 1
  • 9
  • 18
25
votes
5 answers

Disable return key in UITextView

I am trying to disable the return key found when typing in a UITextView. I want the text to have no page indents like found in a UITextField. This is the code I have so far: - (BOOL)textView:(UITextView *)aTextView…
user1445205
25
votes
5 answers

How to make a UITextView move up when keyboard is present

How to move UITextView Up and Down when you start entering some value. Like in TextField we use its delegate method. What to do in case of UITextView ?
Bug
  • 2,576
  • 2
  • 21
  • 36
25
votes
6 answers

NSParagraphStyle line spacing ignored

A simple test that is failed: Make a new project with just one subview (UITextView) and put the following in: - (void)viewDidLoad { [super viewDidLoad]; NSMutableParagraphStyle *paragraphStyle = [[NSMutableParagraphStyle alloc] init]; …
borrrden
  • 33,256
  • 8
  • 74
  • 109
24
votes
7 answers

(iPhone) How to handle touches on a UITextView?

I'm trying to handle touches on a iPhone's UITextView. I successfully managed to handle taps and other touch events by creating a subclass of UIImageViews for example and implementing the touchesBegan method...however that doesn't work with the…
devguy
  • 2,336
  • 5
  • 27
  • 31
24
votes
4 answers

How to make UITextView "Done" button resignFirstResponder?

I am trying to make my editable UITextView resign the keyboard (resignFirstResponder) when the user taps "Done." Using a UITextField, I have been able to do this with the following code: - (IBAction)doneEditing:(id)sender { [sender…
Jason
  • 14,517
  • 25
  • 92
  • 153
24
votes
4 answers

How to Read Number of lines in UITextView

I am using UITextView In my View , I have requirement to count number of line contained by textview am using following function to read '\n' . However this works only when return key is pressed from keyboard , but in case line warapper (when i type…
santosh
  • 504
  • 2
  • 6
  • 20
24
votes
11 answers

Resize UITableViewCell containing UITextView upon typing

I have an UITableViewController that contains a custom cell. Each cell was created using a nib and contains a single non-scrollable UITextView. I have added constraints inside each cell so that the cell adapts its height to the content of the…
vib
  • 2,254
  • 2
  • 18
  • 36
24
votes
7 answers

How to show button ‘Done’ on number pad on iPhone OS 4?

I'd like to add a Done button to the iPhone number pad keyboard. There's even a handy space at the bottom left for just such a button. Previously, I was using a similar trick to those described in Question 584538 and Luzian Scherrer's excellent blog…
Will Harris
  • 21,597
  • 12
  • 64
  • 64
24
votes
3 answers

How do I implement a custom UITextInputTokenizer?

I have a UITextView and am using its tokenizer to check which words the user taps on. My goal is to change what the tokenizer thinks of as a word. Currently it seems to define words as consecutive alphanumeric characters, I want a word to be defined…
Joshua Burr
  • 241
  • 1
  • 6