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
45
votes
10 answers

Setting maximum number of characters of `UITextView ` and `UITextField `

I'd like to set a maximum number of characters allowed to be typed both in a UITextView and a UITextField. This number will be then shown in a little label (for user's reference, Twitter Style.)
biggreentree
  • 1,633
  • 3
  • 20
  • 35
45
votes
10 answers

How to add image and text in UITextView in IOS?

I want to add both text and image in UITextView. The textview should be expanded according to the length of the text and image. In short what I want to do is that when I capture an image from camera or pick from gallery then it should display in…
rahul
  • 2,613
  • 8
  • 32
  • 55
44
votes
2 answers

Can't make URL clickable in UITextView

I'm using Interface Builder to layout my app. I have a UITextView that contains some text, part of which is a URL that I'd like to make clickable (e.g. launches a browser). I've read up on how to do this and believe I'm doing it correctly, however…
Madbreaks
  • 19,094
  • 7
  • 58
  • 72
43
votes
10 answers

How to make a UITableViewCell with a UITextView inside, that dynamically adjust its height, on the basis of the UITextView?

I would like to have a tablew view with a behaviour similar to the iPhone Contacts app by Apple: a uitableviewcell with a uitextview inside, so that when I write in the uitextview, the uitextview increases its height, and so accordingly the…
Tony
  • 439
  • 1
  • 4
  • 3
43
votes
5 answers

UITextView with Syntax Highlighting

How to do Syntax Highlighting in a UITextView, specifically syntax highlighting (and detection) for Objective-C on the iPhone? Some of my ideas of how to do this: NSAttributedString. Now available in iOS 3.2 and greater. But how would I put a…
Joshua
  • 15,200
  • 21
  • 100
  • 172
43
votes
2 answers

How to set font weight as light, regular in Android

I have 3 text views. I need to set their weight as Light, Regular and Condensed. Can someone help me on how to achieve this in Android?
user4582135
  • 519
  • 1
  • 6
  • 14
43
votes
6 answers

It is possible to show keyboard without using UITextField and UITextView iphone app?

I am working in iPhone messaging based app. I want to show keyboard with keyboard inputAccessoryView in keyboard without using UITextView and UITextField. It is possible to do this? Please any one help me on this. Thanks in advance. Looking…
Gopinath
  • 5,392
  • 21
  • 64
  • 97
39
votes
9 answers

UITextView link tap recognition is delayed

In an iOS 7 app, I have a UITextView with a link in it, but tapping the link doesn't fire. It only responds to an awkward "tap and hold". I want it to respond as soon as a user taps on it, like how a UIWebView link tap works. Here is my setup: -…
lehn0058
  • 19,977
  • 15
  • 69
  • 109
39
votes
2 answers

How to set content inset for UITextView in ios

I'm having a UITextView and set content inset as [atextView setContentInset:UIEdgeInsetsMake(0, 10, 0, 0)]; This code working in iOS 6.1 and below, but nothing happens in iOS 7.0.
Muruganandham K
  • 5,271
  • 5
  • 34
  • 62
38
votes
16 answers

Counting the number of lines in a UITextView, lines wrapped by frame size

I wanted to know when a text is wrapped by the frame of the text view is there any delimiter with which we can identify whether the text is wrapped or not. For instance if my text view has a width of 50 px and text is exceeding that, it wraps the…
Abhinav
  • 37,684
  • 43
  • 191
  • 309
37
votes
6 answers

Text views and image view disappearing from view controller in Xcode 6.1 storyboard

I updated to Xcode 6.1 to fix an error I was having with the Interface Builder Cocoa Touch Tool spiking to 99% CPU usage when I used the storyboard, which would freeze Xcode. Now that that error is fixed, I have a possibly even more frustrating…
Ethan G
  • 1,353
  • 2
  • 15
  • 31
37
votes
3 answers

Wrapping Text in a UITextView Around a UIImage WITHOUT CoreText

Is there a way to wrap text from a UITextView around a UIImage without using CoreText? I have been playing around with attributed strings without much luck, and CoreText just seems extremely complicated so I would rather stay out of it.
harryisaac
  • 1,121
  • 1
  • 10
  • 18
37
votes
16 answers

UIView doesn't resize to full screen when hiding the nav bar & tab bar

I have an app that has a tab bar & nav bar for normal interaction. One of my screens is a large portion of text, so I allow the user to tap to go full screen (sort of like Photos.app). The nav bar & tab bar are hidden, and I set the the text view's…
Ben Scheirman
  • 40,531
  • 21
  • 102
  • 137
36
votes
10 answers

UITextView background image

How can I set up a background image to UITextView?
Ilya Suzdalnitski
  • 52,598
  • 51
  • 134
  • 168
36
votes
4 answers

UITextView inside UIScrollView with AutoLayout

I am trying to place UITextView inside UIScrollView with AutoLayout with no luck. What I have tried is, I placed UIScrollView inside the main view in Storyboard I placed UITextView inside UIScrollView in Storyboard and disabled Scrolling Enabled I…