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
24
votes
7 answers

How to adjust the height of a textview to his content in SWIFT?

In my view controller, I have an UITextView. This textview is filled with a string. The string can be short or long. Depending on the length of the string, the height of the textview has to adjust. I use storyboards and auto layout. I have some…
cmii
  • 3,556
  • 8
  • 38
  • 69
24
votes
6 answers

Hyperlinks in a UITextView

I am trying to create a UITextView with a hyperlink so that when the user clicks on the link, they are taken to safari to open the webpage. I have read on link detectors for a textview but those samples always show link detection working if an…
John Baum
  • 3,183
  • 11
  • 42
  • 90
24
votes
3 answers

iOS NSAttributedString to HTML

I have an NSAttributed string (coming from HTML) that I set for a UITextView. - (void)setHtml:(NSString *)html { NSData *htmlData = [html dataUsingEncoding:NSUTF8StringEncoding]; // Create the HTML string NSDictionary *importParams =…
Nic Hubbard
  • 41,587
  • 63
  • 251
  • 412
24
votes
6 answers

Justified Alignment in UITextView - iPhone

In my application, i have a UITextView with many lines, but I need the data with proper appearance. Is it possible to have Justified Alignment in UITextView?
sagarkothari
  • 24,520
  • 50
  • 165
  • 235
23
votes
4 answers

How to set a margin in UITextView?

I'm currently developing a simple text-editing app for iPad. I want to set left/right margins like the attached picture. Just adding UITextView into another UIView with larger width won't work because a scroll indicator won't be properly…
pnmn
  • 1,127
  • 1
  • 14
  • 22
23
votes
1 answer

UITextView Not Detecting Links

I have a UITextView whose content I have set in my .xib. I am trying to get it to recognize a link using these settings: Unfortunately the link does not show up when I run in the simulator (it only shows as plain text): How can I get the…
carloabelli
  • 4,289
  • 3
  • 43
  • 70
23
votes
5 answers

UITextView cursor not positioning properly when editing in iOS 7. Why?

That yellow box above is an editable UITextView that is currently being edited (is first responder). But you probably couldn't tell right? Because there is no cursor. But there is... It's that small blue dot in the bottom left of the yellow…
Joe
  • 854
  • 3
  • 11
  • 21
23
votes
6 answers

Kerning in iOS UITextView

For what apparently is a 'bug,' UITextView does not seem to support kerning like other UIKit Elements. Is there a workaround to get kerning working? To be clear, I'm talking about the spacing in between pairs of characters that are defined in the…
Anthony Mattox
  • 7,048
  • 6
  • 43
  • 59
22
votes
3 answers

Curious Warning Message on UITextView

Has anyone run across this warning message building for the iPhone? More importantly do you understand how to fix it? "unsupported configuration data detection and editable" It's seems to be the UITextView that is complaining. Here's a screenshot.
aaronium112
  • 2,992
  • 4
  • 35
  • 50
22
votes
3 answers

how to write in append mode for text file

My application navigation based. UItextView for notes UIViewController. I am writing data for text to file. Now i need to write in append mode , the below code i am trying but every time is writing to two time with same text data, and not…
SOF
  • 437
  • 2
  • 9
  • 19
22
votes
4 answers

bold part of string in UITextView swift

Here is the text: @IBOutlet weak var legalText: UITextView! let textToAppend = "TERMS OF SERVICE\nLast Updated: May 7, 2015\n\nPLEASE NOTE: The HIGO Terms of Service as stated below is effective as of the 'Last Updated' date above for any user who…
Sarimin
  • 707
  • 1
  • 7
  • 18
22
votes
2 answers

How can I make a UITextView layout text the same as a UILabel?

I have a UILabel that I need to convert to a UITextView because reasons. When I do this, the text is not positioned the same, despite using the same (custom) font. I found that if I set: textView.textContainer.lineFragmentPadding =…
i_am_jorf
  • 53,608
  • 15
  • 131
  • 222
21
votes
8 answers

UITextView scrollEnabled = YES not working after set scrollEnabled = NO in iOS8

I create a demo for checking UITextView scrollEnabled. It only contains 1 UITextView and 2 button enable and disable scroll I test on simulator and device iOS 8, if I click the disable scroll button, the UITextView will disable scroll correctly,…
Linh
  • 57,942
  • 23
  • 262
  • 279
21
votes
2 answers

UITableView beginUpdate/endUpdate causing scroll to top

I've been trying to get my head around this all-too common problem of a expanding UITextView inside a growing UITableViewCell of a UITableView and I'm nearly there except for one small thing. I have a UITableView that has a custom UITableViewCell.…
micnguyen
  • 1,419
  • 18
  • 25
20
votes
5 answers

Xcode - Swift, UITextView won't display on UIStackView

I know that there's a question similar to this already, but his solution didn't solve my problem. What I have is, I've used the storyboard to create a view controller, and then place a child stack view ontop. Using IBOutlet, I've linked the…
HumbleWebDev
  • 555
  • 4
  • 20