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
2
votes
1 answer

How to maintain indentations of HTML content in UITextView in Swift?

I'm showing a lists & sublists in UITextView but it doesn't show indentation for sublists. Here is my code, getting data from HTML format here. extension NSAttributedString { convenience public init?(styled: String, textAlignment: NSTextAlignment =…
Zubair
  • 915
  • 2
  • 9
  • 28
2
votes
0 answers

How to set up roundRect backgroundColor about characters correctly in NSTextView?

I want to set up roundRect backgroundColor for the important characters in NSTextView. The attribute is "tag". I override the func fillBackgroundRectArray(_:count:forCharacterRange:color:) of the **NSLayoutManager **. the code like below: …
Henry
  • 107
  • 1
  • 3
  • 10
2
votes
2 answers

IQKeyboardManager issue , UIViewController top overlapping status bar

I am using IQKeyboardManager. I am showing an UITextView in middle of the screen with transparent background when I click 'reply'. The entire viewController moving up, fine. but when I dismissed, the viewController top is under the statusBar. why…
sudheer
  • 418
  • 6
  • 20
2
votes
1 answer

Add UIButton to UITextView Dynamically with UserInteractionEnabled

I am building an app where I need to add buttons to a UITextView dynamically on the basis of text entered by the user in the same UITextView. The look I want to give is something like To field in message app of iPhone I am unsable to figure out the…
devsri
  • 6,173
  • 5
  • 32
  • 40
2
votes
0 answers

Autoresizing image of html content in a UITextView

I have the body (HTML with images) of a wordpress article obtained via JSON, I'm using a UITextView` to show it and everything works correctly, except that the image that contains the HTML only shows a part. To format the HTML content, I use the…
2
votes
1 answer

Fit TextView to Content and move View Up - Swift

I have a UITextView called composeTextView that is right above the keyboard. This UITextView is inside a View called composeUIView. When the user enters text, the TextView adjusts in size to display all the text. My issue is that when I try to…
badman
  • 95
  • 1
  • 8
2
votes
4 answers

How to detect a string after the '@' is typed in a textview

I have been working on this for a long time now. I have read articles from Get currently typed word in UITextView and Get currently typed word in a UITextView and I think I am very close. My problem is that after I am able to successfully detect the…
Chris
  • 387
  • 5
  • 18
2
votes
4 answers

UITextView inside tableview not resizing according to content

I have a tableView and a UITextView inside it. I am trying to add data from JSON to the table view but it is not shrinking/expanding according to size. I have tried a lot of forums and methods. The main problem is - if it starts expanding/shrinking…
Aman
  • 149
  • 13
2
votes
1 answer

UITextView .isEmpty not working on keyboard send Swift

Have a UITextView that is submitting character input through the "Send" Button on the keyboard. I have tried all of these below, yet it still makes it through with no characters. func textView(_ textView: UITextView, shouldChangeTextIn range:…
husharoonie
  • 431
  • 1
  • 4
  • 19
2
votes
2 answers

iOS - NSNotificationCenter multiple UIKeyboard notification

I have two view controllers let's call them A and B (1) in A I show a popOver containing a textField (2) in B there is an UITextView used for simple text editing I Have to manage the keyboard in A and in B to scroll the content hidden by the…
oiledCode
  • 8,589
  • 6
  • 43
  • 59
2
votes
0 answers

Align bullet in NSAttributedString with UITextView

i have a problem aligning text within a bullet in html. I use NSAttributedString inside UITextView var htmlAttributedString: NSAttributedString { guard let data = data(using: .utf8) else { return NSAttributedString() } do{ return try…
Sonic Master
  • 1,238
  • 2
  • 22
  • 36
2
votes
1 answer

Printing random string from an array on textview

I can't seem to get my array printed onto my textview. I have an array and have set my textview (texthold) to the randomIndex of the array.. Anything you guys see I'm doing wrong? This is my button that when clicked is supposed to get a random…
2
votes
1 answer

Detecting UITextView text direction

I support both Left-to-Right and Right-to-Left in my application. How can I detect text direction in my UITextView/UITextField? I can't use device's locale because user can have multiple keyboards with languages with different read/write…
Maria
  • 755
  • 1
  • 11
  • 29
2
votes
0 answers

uiimage add to uitextview and resizing image with Drag , swift

I have this code, I read image from Library and I want to resize the image in uitextview with dragging it (in real time ). Does anyone know how can I do this? func imagePickerController(_ picker: UIImagePickerController,…
Miloo
  • 117
  • 1
  • 2
  • 10
2
votes
1 answer

Select whole text of UITextView using Swift

I tried to do this the same way as I'm doing it with a UITextField: textView.selectedTextRange = textView.textRange(from: textView.beginningOfDocument, to: textView.endOfDocument) What am I doing wrong?
l30c0d35
  • 777
  • 1
  • 8
  • 32