Trip
Trip

Reputation: 27114

Text in UIScrollView is running horizontal

I'm attempting to make a horizontally scrollable text.

The text is dynamic, but very large, therefore I need a dynamic amount of horizontal space and the ability to scroll.

My tree :


enter image description here


I set my view to constraints 0, -20, -20, -340 ( top, left, right, bottom ) though I wish the bottom was dynamic as I'm never going to know how much text to use.

Then I set contraints to center my UILabels in the middle.

But when I run it, the app looks like this :

enter image description here

No sure what I might be missing.


My storyboard :


enter image description here

Upvotes: 0

Views: 61

Answers (1)

Maulik Bhuptani
Maulik Bhuptani

Reputation: 616

remove autolayout for this particular screen

yourView.translatesAutoresizingMaskIntoConstraints = false

and try to set all your frames including scrollview's size & its content in

- (void) viewDidAppear:(BOOL)animated 

good luck.

Upvotes: 2

Related Questions