UITextView Line break mode for new lines - ios

I am working on an UITextView where I have many lines. The width of lines is less than the width of uitextview frame width.
I want to display ellipses when there are multiple lines which are not visible (because of uitextview height is less ) instead of showing scroll bar (I am not showing the scroll bar because the user doesnt want to see the scroller in that textview).
I have used lineBreakMode property but that does work only in one line.

Related

How can I have textview as scrollable inside a stackview and keep it visible?

I currently have an app which displays questions and answers as text in textview objects. These textviews are wrapped in stackviews along with navigation buttons.
If I set the textview to non-scrollable (by unchecking the scrollable button) the text displays, but long text runs off the screen and of course the user can't scroll down to read it. If I check the scrollable button, the text isn't displayed at all - just blank space.
Any idea how I can either: set the text to be scrollable and display or set the text to autoshrink (as it doesnt run over by much).
That much to say about textViews -> Replace the textViews with labels with 0 of lines -> This guarantees that the label will be autoshrinking vertically, just set width and the stackView into scrollView and you are at it :)

Subview greater than its superview in ios / objective c

I have a view of limited width, lets say it 100.
I have multiple labels of same width inside that view and its text is centre aligned. So that text seems to be center aligned always.
Problem is when I got long text label it shows ellipses at the end of the text but I want to show whole text in one time while keeping superview width unchanged. Is it possible to attain this? If not then show how can I wrap that text if it is larger than its width. I'm new to IOS programming.
There is an issue with UILabel and autolayout. If you using it - check this answer: iOS: multiline uilabel only shows one line with autolayout
Also, check actual size of label and insure clipsToBound of superview is set to NO.

UITextView scroll to end automatically issue

I have set auto layout constraints to my text view and now when I rotate the device app sometimes automatically scrolls text view to the end of content. For example in case when I have many words in the textview and the content size is bigger then text view, then I see not a top word but see instead bottom words. And never see the First word of text.
As you can see the text is cut off on the visible first line. Because it scrolled. But I just want to see top of text view not a bottom.

top of scrollable text is cut off

I am working with storyboards and have put text inside a table cell within a ViewController. The text shows up correctly in portrait view without need for set constraints. However, on landscape view without constraints the text does not fill the entire width. Thus, I apply constraints to fill the canvas with text but the top part of the text does not appear.
I have this hierarchy:
View Controller
Table View
Table View Section
Table View Cell
Content View
Label
Constraints
(Constraints are set for vertical top, and both horizontal sides)
I have autolayout checked, working with attributed text, word wrap, with about 30 lines and indent head at 20. Without an indent the clipping or cutting off does not occur, but it makes my text start about midway on the screen as opposed to just below the navigation bar.
Any help with this would be much appreciated.
EDIT: Attached Link https://www.flickr.com/photos/115284261#N02/sets/72157640082717193/

UITextView horizontal scrolling

I have a UITextView which wrapping words of long text and it have a vertical scrolling functionality.
How can I switch off the word wrap, and switch on the horizontal scrolling with keep the vertical scrolling?
i have seen this answer in stackoverflow only..
Let's say I want a scrollable width of 600 and a visible width of 250.
The first step is to make the UITextView a wide as the area you want to be scrollable. So what you would have put into contentSize, in this case 600.
Then the right inset is set to the difference between the actual width and the width you wanted. In this case 350.
This way cursor is restrained to the width you need BUT there is text visible to the right of your desired width, after all, the UITextView IS 600 pixels wide.
Now here's where the really hackish bit comes in, don't read on if you're sensitive or have a weak stomach.
Get an image of the user interface to the right where UITextView should end. Insert it into the NIB as an UIImage view and put it back in it's place, making sure that it's on top of the UITextView.
When the view is displayed, the cutout sits on top of the UITextView and hides the text overrun.

Resources