Setting UIScrollView position after each scroll - iphone

i have a scroll View which contains 10 images on a row.
the fiarst 5 items will display on the screen at first time
the remaining 5 images will display only after the scroll.
However ,I need to display only one image per each scroll.
Details
i have 10 images in my scroll view on a row.
1st,2nd,3rd,4th,5th images will dispaly at the firt time.
when first scroll is done , i need to dispaly the 2nd,3rd,4th,5th,6th images
after next scroll,i need to dispaly the 3rd,4th,5th,6th,7th images
after next scroll,i need to dispaly the 4th,5th,6th,7th,8th images etc.
is there any way to do it?
can any one provide me a good way.
Thanks

See the paging property in UIScrollView class.
Also you can stop scrolling in - (void)scrollViewDidScroll:(UIScrollView *)scrollView when image 6 will appear. After second scroll stop when image 7 will appear etc.

Setting UISCrollView Position:
[myScrollView scrollRectToVisible:CGRectMake(x,y,width,height) animated:NO];

I think that you use paging functionality for your case? If I right you can try making your scrollview less than the size of the screen (width-wise), but uncheck the "Clip Subviews" checkbox in IB. See more in this question.

Related

How to make a scrollable view in iOS?

i am looking to create an "options" page for my application and because they are many , the screen of the phone is not enough to show.
So i need the user to be able to scroll down the view to see more options till the last. I know i should use the scrollview , but i dont know how.
All the tutorials i ve found are about scrolling all over the screen , zooming , scrolling from left to right , but nothing on how u can create a simple page scrolling up and down.
How exactly do i do that? Do i make many .nib files and somehow i connect them? Do i make a big .nib file?
Can someone guide me to a tutorial on that?
Use ContentSize property of UIScrollView to scroll what ever area you want. i.e.
take UIScrollView add it on UIView with exist height of iPhone. i.e. max 460.0
So ScrollView frame will be max (0,0,320.0,460.0).
Now after adidng ScrollView to View set ContentSize property to upto scrollable area.
[self.mainScrollView setContentSize:CGSizeMake(self.mainScrollView.frame.size.width, 1000.0)];
UIScrollView *mainScroll = [[[UIScrollView alloc]initWithFrame:CGRectMake(x,y,w,h)]autorelease];//scrollview width and height
mainScroll.scrollEnabled = YES;
mainScroll.userInteractionEnabled = YES;
mainScroll.showsVerticalScrollIndicator = YES;
mainScroll.contentSize = CGSizeMake(width,height);//width and height depends your scroll area
..........
//add subviews to your scrollview.....
[mainScroll addSubview:view1]
............
[mainScroll addSubview:view2]
..............
[mainScroll addSubview:view3]
[self.view addSubview:mainScroll];
Note :: contentSize property determines your scroll
area.Scrolling
enabled only if your scrollview content larger than scrollview height..
You could use a Table View with static Cells, that will scroll automatically if it needs to, much easier. Also with a Table View you can choose to scroll up, down, left, right, set bouncing etc from the Attributes Inspector.
Make only 1 nib file.
give height of scroll view large as you want.
then place your buttons , textfeild on scroll view
There are two ways :
make settings bundel for your app check this Press Me
to make UITableView with custom cells >> it is easy if you use
Interface Builder Press Me

Are scroll view images removed from memory after they are scrolled to the left?

I have a scrollview which is continuously scrolling . The scroll view has the images with full size as the screen 320 * 480. So only one image is seen on the screen at a time. The scroll view is continuously scrolling while my application is in running state. While profiling the application I found that the instead of image added to the scrollview my memory is not increasing. My question is after image is scrolled out from the scroll view is it removed from the memory or do I need to do it explicitly ?
It won`t removed from the memory automatically.
There are 2 ways to handle it.
The 1st way is : You can keep only 3 imageView on the scrollView. and add or remove other imageView in the scrollView by the scrollView`s delegate such as
- (void)scrollViewDidScroll:(UIScrollView *)scrollView
The 2nd way is : to keep a 3 pages scrollView , and change the image when the scroll is scrolling.you can see the demo : https://github.com/smallqiang/cycleScrollerView
Another way is to use UITableView, rotated by 90, with cells, rotated by -90. In this case only visible pictures will live in memory.

Unable to click on any part of the UIScrollView to scroll through the images. There is only a specific porition I can click on

I've some UIImages loaded into a UIScrollView.
However, when I try to scroll through these UIImages, I can only click on a specific area in the screen.
What is the property I should look out for to expand the "clickable area"? Such that I can click on any part of the scroll view to start scroll through the images.
Is there anything to do with content size of the scroll view?
Make sure that -userInteractionEnabled is NO for the views you add to your scroll view.
Update:
Set -clipsToBounds to YES and see whether the scrollview's frame is just too small and the content goes beyond the bounds of the view.

How to slide button vertically in iphone?

How to slide button vertically in iphone by programmatically ?
Hey i have 7 images. and i want to display only 3 images vertically. and other images will be display when user scroll it upward.
Take a look at UIScrollView class :-) and then at UIImageView
If I understand what you want to do...
But we won't code you the thing ;-)
Good Luck.
add scrollview and setPagingEnabled =yes;
then
two way
1.add all images in view as subview and set the frame of them by one by one
2.in one view while scroll up add next image in view and remove old image.
right.Got it?
i think this tutorial will help you
http://www.edumobile.org/iphone/iphone-programming-tutorials/pagecontrol-example-in-iphone/

How can i move images on touch event?

I have created a image gallery. I show all images from plist file in navigation view. When i open image in full view after that i have to back in navigation. But i want to move images in scrolling when image in fullview. After open image in full view i want to swap one by one next as well as previous...
Is there possible..??
Plz give me help about any kind..
Regards....
Yes thats possible, make your fullview a scrollview with its contentsize having the same width as your screen and its height being the combined height of its subviews (put at least two or 3 imageviews in the scrollview as subviews). You can add and remove UIImageviews as subviews of the uiscrollview as the user vertically pages through them. You will need to communicate with the navigation view what the table status is when your user returns to that view though so that everything matches up.