Questions tagged [nstextcontainer]

NSTextContainer is an iOS class that defines a region in which text stored in an NSTextStorage object is displayed using an NSLayoutManager object.

47 questions
1
vote
1 answer

NSTextContainer exclusionPaths move with text

I am trying to implement exclusionPaths for my custom views inside UITextView, and move them with text during text editing similar like in Pages app. I am trying to add a custom attribute for the attributedText, where custom view should be and I am…
Michal Zaborowski
  • 5,039
  • 36
  • 35
1
vote
0 answers

How to rotate the text fragments of a NSTextContainer in a UITextView?

I'm using a UITextView and want to change the angle of the text fragments as described in the drawing below. The current result shows my actual way: frameText.layer.transform = CATransform3DMakeRotation(DEGREES_TO_RADIANS(angle), 0, 0, 1); As…
Dirk
  • 2,011
  • 1
  • 20
  • 25
1
vote
0 answers

iOS 7 UIKit NSTextContainer initWithSize:(CGSize)size conflict

I have recently upgraded my xcode4.6 to 5.0 and I am facing conflict issues which I am not sure how to resolve. I am using cocos2d library and CCGrid file in it is using UIKit framework. Now UIKit function of NSTextContainer…
xrnd
  • 1,273
  • 3
  • 21
  • 38
1
vote
0 answers

Cocoa NSTextContainer: How to maintain whitespace after gap?

I am creating a gap in text by overriding NSTextContainer's "lineFragmentRectForProposedRect" and returning a remainingRect. This works overall, but it is undesirable to me that the "remainingRect" portion of the text container hides whitespace at…
Tyler
  • 165
  • 1
  • 7
0
votes
0 answers

How to get the attributed string in the NSTextContainer not the NSTextStorage

Good day, Im trying to get the attributed string for the NSTextContainer not the NSTextStorage, any time I use the method that returns the attributedString of a textView, it returns the attributedString for the NSTextStorage and I just want the…
0
votes
0 answers

How to get the selected text block in NSTextTable

Good day, I’ve been struggling with this recently. I would like to know how you can get the selected text block of NSTextTable so I can add blocks below and above and I would also like to know when a user is editing an NSTextTable.
Matthew1998
  • 119
  • 2
  • 8
0
votes
1 answer

Prevent UITextView from offsetting its text container

I am tying to modify the height of a UITextView dynamically (up to a max height) while the user enters text. I am experiencing a very strange behavior when there are an even number of lines in the text view. I am using autolayout and the text view…
d370urn3ur
  • 1,736
  • 4
  • 17
  • 24
0
votes
1 answer

Arabic and english characters in uilabel

I use: - (void)handleLinksTouch:(CGPoint)touchPoint { NSTextStorage *textStorage = [[NSTextStorage alloc] initWithAttributedString:self.attributedString]; NSLayoutManager *layoutManager = [[NSLayoutManager alloc] init]; …
0
votes
0 answers

Trouble aligning baselines of NSLayoutManager

I'm developing a custom UIView that renders text using a number of separate NSLayoutManager objects. (This view has text positioning requirements beyond what the built-in text view classes can support.) I'm having a hard time getting the correct…
Ted Hopp
  • 232,168
  • 48
  • 399
  • 521
0
votes
1 answer

Text garbled when using NSTextContainer/NSLayoutManager with UITextView

I'm implementing paged text and so I'm using NSLayoutManager and NSTextContainer to create UITextViews for each page. The paging is working fine, but the text is garbled. When setting the same NSTextStorage on a vanilla UITextView it appears…
arsenius
  • 12,090
  • 7
  • 58
  • 76
0
votes
0 answers

How append string to a new line after setting exclusionPaths Rather than use NSTextAttachment?

How UITextView can append string to a new line like below screenshot show? Thanks for helping me. Here is my code. main code: - (void)viewDidLoad { [super viewDidLoad]; NSTextStorage *storage = [NSTextStorage new]; NSLayoutManager…
james
  • 643
  • 4
  • 24
0
votes
0 answers

ensure layout in NSLayoutManager

I have a UITextView with lots of text. The scrolling is mostly smooth on iPhones 4, 5, and 6, but on the 6 Plus there is lots of stuttering. (I believe this is because the 6 Plus is underpowered for the amount of pixels it has to push around). I…
Casey Perkins
  • 1,853
  • 2
  • 23
  • 41
0
votes
2 answers

How to apply custom bezier path to a UITextView inside a UITableViewCell

I am working with a UITableViewCell. The cell contains a number of images, a label, and a UITextView. I want the UITextView drawn with the other views as its exclusion paths. So inside my class MyUITableViewCell, I have the following code inside the…
Katedral Pillon
  • 14,534
  • 25
  • 99
  • 199
0
votes
1 answer

UITextView becomes unselectable when using textstorage with textcontainer in iOS

I am trying to display NSAttributedString to UITextView. I have used NSTextStorage, NSLayoutManager and NSTextContainer. But what happens is UITextView becomes unselectable. When i try to select , i can't find any selection or copy - paste…
Karan Alangat
  • 2,154
  • 4
  • 25
  • 56
0
votes
0 answers

Using UITextView

I am trying to create a textview that holds a 3 line string. As the user works, the string will update and become wider, the height (number of lines) will remain the same. Reading through the documentation I understand that the size of the container…
physics90
  • 946
  • 3
  • 9
  • 24