user2000452
user2000452

Reputation:

How to increasing scrolling area of UIScroll view

I have a scroll view with 5 images and some text views. It scrolls horizontally.

Now, when I scroll the content of the scroll view moves to an area.
How can I increase this limit?

I mean: I need to scroll more on single scrolling.

I have tried with increasing the contentSize.
It does not have the desired result: only the content of scroll view got increased.

Upvotes: 1

Views: 800

Answers (4)

Nazik
Nazik

Reputation: 8444

Try this

use UIScrollviewdelegate in .h file

and then use

-(void)scrollViewDidEndScrollingAnimation:(UIScrollView *)scrollView
{

in that function use

[scrollview setContentOffset:CGPointMake(scrollview.frame.origin.x+(value u want to scroll more) , 0) animated:TRUE];

The above code will allow ur scrollview to scroll more

Upvotes: 0

Naimish Karia
Naimish Karia

Reputation: 346

you can set contentoffset property of scrollview in scrollview delegate method

- (void)scrollViewDidScroll:(UIScrollView *)scrollView

Upvotes: 2

Bhanu Prakash
Bhanu Prakash

Reputation: 1483

Try with code....

[scrollView setDecelerationRate:UIScrollViewDecelerationRateFast];

Upvotes: 2

Manann Sseth
Manann Sseth

Reputation: 2745

You can try it on viewDidLoad method :: scr.contentSize = CGSizeMake(320, 500);
or whatever you want height.

Otherwise you can set it dynamically after all images & textviews will be loaded.

eg. float h = [imagesCount * imageHeight] + [textVwCount *textVwHeight] + 100;

then set to scr.contentSize = CGSizeMake(320, h);

But keep in mind, always put height's value greater than actual size for ScrollView control.

Hopefully it will help you.

Thanks.

Upvotes: 1

Related Questions