stackoverflow.com/questions/1… 参考这篇文章。xcode
目前我用的xcode11不须要答主那么多步骤,经测试只要增长两个keypath就能够了ide
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).ui
8: Add a runtime attribute with KeyPath frame with Type RECT and 0,0,320,416.code
1.选中你的scrollview,点开identity InspectorM
2.在user defined runtime attribute栏里增长两个keypath,一个是contentSize,类型是SIZE,填入宽高,例如(320,1000)。一个是frame,类型是RECT, 例如0,0,320,416get