Label doesn't show all the text inside scrollView

前端 未结 4 1514
渐次进展
渐次进展 2021-01-03 15:18

I want the DecriptionLabel (the Lorem Ipsum one) to have all the text inside it visible. As you can see, it is getting trimmed.

The two buttons should b

4条回答
  •  没有蜡笔的小新
    2021-01-03 15:55

    You should add the following constraints: (following in sudo code)

    // Constraints for ScrollView
    scrollView.top = ViewController.view.top
    scrollView.leading = ViewController.view.leading
    scrollView.trailing = ViewController.view.trailing
    scrollView.bottom = ViewController.view.bottom
    
    // Constraints for View
    view.top = scrollView.top
    view.leading = scrollView.leading
    view.trailing = scrollView.trailing
    view.bottom = scrollView.bottom
    
    // Width of view
    view.width = ViewController.view.width
    

    Now you just need to make sure you have layout constraints for each child of the 'view' and it's height will be correct and display the full size of the textview.

提交回复
热议问题