Let suppose I have content in one column of ag-grid more than the width so it's coming in next line, but I need to restrict that and show ellipsis if content is more than 2 line
Related
I have a UICollectionView that uses UICollectionViewCompositionalLayout.
I have multiple sections each section contains a specific number of items (based on the model data) each section has items with estimated width and an absolute height (which is fine)
each cell contains a textview that has initial text so it's sized based on the estimated size for the text that it contains(the initial text)
these textviews are active and i want them to be dynamic (when i start typing i want the cell that's containing the textview that is being edited now to expand horizontally).
Using Vaadin 7 , I am trying to display "tooltip" (only) if the text in a grid cell is truncatedĀ (with ellipsisĀ "...") ?
How can I find out if the text in the cell is truncated ?
I tried to find out the width of the column( comparing it to the length of the string in a cell). But the width of the column always returns "-1.0".
Thanks
I have a subclass of UITextView used to display a custom view within the text flow. It's adding an exclusionPath for the custom view, and rendering it's content within that region using autolayout. That part is working, and the text wraps around the image as well. The challenge is that I want to have custom line spacing such that the second line of text is always below the image. I've played with layoutManager:lineSpacingAfterGlyphAtIndex:withProposedLineFragmentRect: and can adjust the line spacing for characters using a row calculation based on the contentSize and lineHeight.
I can determine if a character is in the first line and adjust it's lineSpacing correctly. The problem is when a character wraps, the first character won't cause a re-check of the characters on the first line. If I type a second wrapped character then all is fine; the first line will have the line spacing added to it. This causes the layout to jump when the second wrapped character is entered.
In other words what I'm trying to do:
- Put a custom UIView inside of a UITextView
- Have a standard line height for a single line of text.
- If more than 1 line of text is needed then adjust line 1's lineSpacing to wrap line 2 under the image.
Sorry if my diagram is crude, but here's what I'm seeing:
-------------- First line of text view content
| CustomView | second line of text view content
-------------- third line of text view content
fourth line of text view content
Here's What I'd like:
-------------- First line of text view content
| CustomView |
--------------
second line of text view content
third line of text view content
fourth line of text view content
Am I missing something? Is the contentSize.height just not updated until after the character is rendered? Is there a better way to get the height of the box, or determine if the textbox is rendering to more than one line?
Update: I can identify the case where the number of rows (based on contentSize) is 1 (should be 2) but the glyph's rect.origin.y is > 0, then call invalidateIntrinsicContentSize. That does allow the rendering to display as it's needed, but does cause extra calls to invalidate and seems pretty heavy.
I have a UITextView in a prototype UITableView cell. I'd like to dynamically indent the first line of the UITextView to make room for a button that will have a variable width depending on the cell row. The button will vary in width because it's title will contain usernames in an activity feed.
Think of Instagram or any app that has a feed with clickable usernames on the left and text directly following.
I've been able to get close by counting the number of characters in the button title and left padding the text of my UITextView with a series of #" " blank spaces. This is akin to what other SO posts have suggested.
This is inaccurate for me because the width of blank spaces don't precisely match that of the button title because different characters have different widths.
Does anyone know if it is possible to indent a UITextView by a specific float value? I've been able to convert the width of the button title to a float and I believe that this would solve my issue.
I have been recently getting into iOS development, and I'm trying to build something that looks (very roughly) like this: http://falkendev.com/downloads/ios-sample.png
Basically, it's a page that shows simple text -- large header text that may span multiple lines, a separator line, and then smaller descriptive text that may be a variable length. This text does not need to be editable. I'm working using interface builder, but I imagine that what I want done may need to be done programmatically?
Two questions:
-- How do I go about creating these text fields so that they adjust their height based on the content? I'm assuming I would be using a standard "text" field for each, make them not editable, and then programmatically change their height? And then based on the height of the various text fields, I would need to adjust the positioning of the text fields and the divider line between them?
-- How do I go about making the page scrollable? It's possible that the descriptive text will be long and would extend off the edge of the screen. I would want the whole page to be scrollable, not just the descriptive text section. I'm assuming I would place all my elements within a scroll view... but currently when I do that and view it, the view just gets centered (cutting off both the top and the bottom) and I can't scroll it at all.
Thanks for any help!
set the scrollview content size to greater than its actual size to
make it scrollable like this :
scrollView.contentSize = CGSizeMake(YourWidth ,YourHEight ); // Here you can change either of height and width to make it more scrollable in that direction.
You can use UITextView object to have a scrollable text field...
which can scroll to show additional text..just set its editing
property to NO.
Otherwise to dynamically update label height yourself...use
NSString sizeWithFont method