0

My label.text is very huge. I have ensured that my label will contain any amount of text. I just want my view controller to be scrolled so that I can read my label.

I think it's possible with storyboard itself, but I'm not able to do it.

I tried "editor -> embed in -> scroll view". I also tried adding scrollview to my view controller but nothing worked.

Tunaki
  • 132,869
  • 46
  • 340
  • 423

3 Answers3

1

I see u need to show very long text, then u should use UITextView, its basically scrollView for very long text, and can be resize

Tj3n
  • 9,837
  • 2
  • 24
  • 35
  • no i need the entire view controller to be scrollable. – Parthasaarathy Sudarsan Dec 30 '15 at 09:17
  • Then u might want to check this out [UITextView - Horizontal Scrolling?](http://stackoverflow.com/questions/15190000/uitextview-horizontal-scrolling), it basically explain how to make your Label subview of a ScrollView, if thats what u really needs – Tj3n Dec 30 '15 at 09:20
1

Maybe you can set the label's property numberOfLines is 0. A Value of 0 means no limit. The text will truncated using the line break mode.

SandDepp
  • 63
  • 8
0

Please specify more for Whole ViewController scrollable means ..

If you add textView then also your view controller is scrollable if you have scroll view in Main view of View Controller.

Nested scroll works very well and scroll whichever scrollview is dragged by user.

And if you want your UILabel scrollable then you need to set ContentSize of scrollView whenever you change Content(text) of UILabel, and don't forget to set Number Of Lines 0 of your UILabel.

dev_m
  • 796
  • 6
  • 12