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

How to insert placeholder in UITextView?

Is there any way to insert a placeholder in a UITextView similar to the UITextField? If yes, then please send me any link or any idea to implement this functionality.
Nikunj Jadav
  • 3,417
  • 7
  • 38
  • 54
51
votes
13 answers

UITextView is not scrolled to top when loaded

When I have text that does not fill the UITextView, it is scrolled to the top working as intended. When there is more text than will fit on screen, the UITextView is scrolled to the middle of the text, rather than the top. Here are some potentially…
Michael Campsall
  • 4,325
  • 11
  • 37
  • 52
49
votes
2 answers

UITextView renders custom font incorrectly in iOS 7

My app uses a UITextView to input Syriac text (Estrangelo font), but UITextView renders some letters incorrectly like this: I tested it with a UILabel and a UITextView. UILabel displays it correctly, but UITextView incorrectly displays the top dots…
LE SANG
  • 10,955
  • 7
  • 59
  • 78
49
votes
12 answers

UITextView text not starting from top

I have a UITextView. I want its text to start from top but I it is not coming from top. Please have a look at my code : UITextView *myTextView = [[UITextView alloc] init]; myTextView.frame = rect; myTextView.editable = NO; myTextView.font =…
Nitish
  • 13,845
  • 28
  • 135
  • 263
48
votes
5 answers

Multi-line user input in iOS: UITextField vs UITextView

I need to show users a multi-line text input "box" with a height greater than the standard height of a UITextField. What the best or most correct approach should be?: Using a UITextField and change its height in code or by applying a certain height…
AppsDev
  • 12,319
  • 23
  • 93
  • 186
48
votes
7 answers

How to apply text shadow to UITextView?

Actually I love UILabel. They're sweet. Now I had to go to UITextView because UILabel is not aligning text vertically to the top. Damn. One thing I really need is a text shadow. UILabel has it. UITextView seems to not have it. But I guess that guy…
dontWatchMyProfile
  • 45,440
  • 50
  • 177
  • 260
48
votes
7 answers

How to hide UITextField border?

I have a UITextField and I am trying to make the UITextField border invisible so that the background and UITextField would have the same color and there would be a seamless look. But the problem is I also use a placeholder and there is a border that…
user984694
48
votes
11 answers

UITextView disabling text selection

I'm having a hard time getting the UITextView to disable the selecting of the text. I've tried: canCancelContentTouches = YES; I've tried subclassing and overwriting: - (BOOL)canPerformAction:(SEL)action withSender:(id)sender (But that gets…
dizy
  • 7,951
  • 10
  • 53
  • 54
47
votes
4 answers

How to get UITextView to respect newlines in Interface Builder?

I have a simple app with a UITextView embedded into a UIScrollView. Interface Builder won't let me add multiple newlines for spacing; when I hit return it sees that as "end of input" rather than appending the newline to the UITextView. How can I…
George Armhold
  • 30,824
  • 50
  • 153
  • 232
47
votes
8 answers

How to show HTML text from API on the iPhone?

The best example to explain my situation is to use a blog post. Let's say I have a UITableView loaded with title's of blog posts that I got from an API. When I click on a row I want to show the detailed blog post. When doing that, the API is handing…
rpheath
  • 1,057
  • 1
  • 13
  • 18
46
votes
7 answers

How to change the uitextview font size

can any one help to change the font size in UITextView. [textView setFont:[UIFont fontWithName:@"ArialMT" size:30]]; I use this one but it doesn't work.
mychar
  • 1,031
  • 1
  • 11
  • 20
46
votes
2 answers

How do you make a vertical text UILabel and UITextView for iOS in Swift?

If you came to this question based on the title but are not interested in Mongolian, you might be looking for this Q&A instead: Swift: How can you rotate text for UIButton and UILabel? I've been learning Swift in order to develop iOS apps for…
Suragch
  • 484,302
  • 314
  • 1,365
  • 1,393
46
votes
6 answers

UITextView data change swift

How can you detect a change of data in a UITextView with Swift? The following code does not do any detection. I am declaring the UITextView : @IBOutlet weak var bodyText: UITextView! optional func textViewDidChange(_ textView: UITextView!) { …
user3896519
  • 515
  • 1
  • 4
  • 8
46
votes
13 answers

UITextViews in a UITableView link detection bug in iOS 7

I have custom UITableViewCells that contain a UITextView. I have link detection in the UITextView turned on in Interface Builder. When I first load the table view, everything seems to be working, but as I scroll up and down the table view, the link…
Darren
  • 10,091
  • 18
  • 65
  • 108
46
votes
10 answers

Hiding the Keyboard when losing focus on a UITextView

So I have a UITextView that I'm using to allow the user to submit some text. My problem is, I can't seem to figure out how to allow the user to 'Cancel' by tapping away from the UITextView.
tuzzolotron
  • 718
  • 2
  • 7
  • 11