stackoverflow.com/questions/1… 参考这篇文章。
目前我用的xcode11不需要答主那么多步骤,经测试只要增加两个keypath就可以了
6: Click on your scrollview and click on Identity Inspector.
7: Add a User Defined runtime attribute with KeyPath of contentSize then type of SIZE and put in your content size. For me it is (320, 1000).
8: Add a runtime attribute with KeyPath frame with Type RECT and 0,0,320,416.
1.选中你的scrollview,点开identity InspectorM
2.在user defined runtime attribute栏里增加两个keypath,一个是contentSize,类型是SIZE,填入宽高,例如(320,1000)。一个是frame,类型是RECT, 例如0,0,320,416