UITextView inside UIScrollView with AutoLayout

后端 未结 4 1080
庸人自扰
庸人自扰 2020-11-28 06:09

I am trying to place UITextView inside UIScrollView with AutoLayout with no luck. What I have tried is,

  • I placed UIScrollView inside the main view in Storyboar
4条回答
  •  醉酒成梦
    2020-11-28 06:44

    It seems that this question has an answer that has worked for a number of people. However, it should be noted that the documentation states:

    Placing a text view inside of a scroll view. Text views handle their own scrolling. You should not embed text view objects in scroll views. If you do so, unexpected behavior can result because touch events for the two objects can be mixed up and wrongly handled.

    Before trying to put a UITextView in a UIScrollView you should consider if this is really necessary. If the text view is part of a complex layout within the scroll view, then note the use of the UIView container in the accepted answer.

    See also: Scroll Views Inside Scroll Views

提交回复
热议问题