I have a scrollview with block of information. An example of the function i am looking for is. ..
Button A
Button B
Button C
ScrollView – has a height of 3000, width 320 (portrait layout in iOS)
button A i set the cgPointMake
[scrollViewSettings setContentOffset:CGPointMake(0,0)];
button B i set the cgPointMake
[scrollViewSettings setContentOffset:CGPointMake(0,1000)];
button C i set the cgPointMake
[scrollViewSettings setContentOffset:CGPointMake(0,2000)];
I do not have any code beyond this in regards to setting scroll limits or scroll range.
what i need is
Button A to have a scroll height range from y=0 to y=1000 so the user cannot scroll to see data where button B or C will take them.
Button B to have a scroll height range from y=1000 to y=2000 so the user cannot scroll up or down to see data where button A or C will take them.
Button C to have a scroll height range from y=1000 to y=2000 so the user cannot scroll up to see data where button A or B will take them.
I hope this makes sense.
Thank you in advance.
Here is the code i used for each scrollview
scrollViewMain.frame = CGRectMake(0, 54, 320,426); /*set the viewable frame of the scroll view*/
[scrollViewMain setContentSize:CGSizeMake(320,1708)]; /*set the content size of the scroll view*/
scrollViewSettings.frame = CGRectMake(0, 0, 320,426); /*set the viewable frame of the scroll view*/
[scrollViewSettings setContentSize:CGSizeMake(320,650)]; /*set the content size of the scroll view*/
scrollViewBMI.frame = CGRectMake(0, 426, 320,426); /*set the viewable frame of the scroll view*/
[scrollViewBMI setContentSize:CGSizeMake(320,570)]; /*set the content size of the scroll view*/
scrollViewBFC.frame = CGRectMake(0, 1278, 320,426); /*set the viewable frame of the scroll view*/
[scrollViewBFC setContentSize:CGSizeMake(320,568)]; /*set the content size of the scroll view*/
ViewBMR.frame = CGRectMake(0, 852, 320,426); /*set the viewable frame of the view*/
Why don’t you use 3 differents UIView and display the view you want in the scrollview.
Ex :
Create a first view that contains the same UI than your range (0 to 1000)
Create a second view that contains the same UI than the second range (1000 to 2000)
etc…
And add the view you need when button A or B or C is pressed (removing the previous view).
Hope it’ll help you.