I have got a layout in following form
I have got the views in following hierarchies.
---View
-------TopView
---------Label
--Scrollview
---------ContentView
----Buton
The content view has got the constraing attributes as in the following picture,
The problem is that scrollview is not getting scrolled. Am i missing any layout constraints from being set? scroll view is of width 374 and height 534. Contentview is of width 334 and height 494
Every time you try to add the scroll view on something like submit application/ form then remember these steps:
On base view add a scroll view with frame exactly equal to base view
add top left bottom and right constrain (should be 0 each)
Have you set ScrollView contentSize ?
Please check you have set scrollable height.
Eg.
scrlVIewSignUp.contentSize = CGSizeMake(self.view.frame.width, 1000)
Where 1000 is the approximate height.(please set height as per your requirement)
I assume you are running into issues with the contentSize. Check out this .it is about how to handle the contentSize when using a "pure" AutoLayout approach. The gist of it is that your constraints implicitly define the content size. You NEVER set it explicitly when using AutoLayout.
it also have, attached example project at the end of the blog post to demonstrate how it works.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.