Please do not post the same thing multiple times. The board software automatically flags certain posts as needing moderator attention. This happens the most often for new users. I'm pretty sure this is made clear at the time you attempt to post. Posting the same thing over and over again just makes that many more posts the moderators have to weed through later. This makes us sad. Don't make us sad. If your post/thread doesn't appear, just wait a while. Don't post it again. If it hasn't shown up by the next day, then you can try again. I normally go through posts in the mornings, and try to check a few times throughout the day, but I'm not here 24/7. There will typically be a significant delay before posts are approved. Just be patient.
This is a simple tutorial on how to add a UIScrollView to your project.
Unfortunately, the embedded versions of these videos from vimeo.com aren't in HiDef. To see them in HiDef, you'll either have to view them at vimeo.com or you can download a HiDef version to your computer with the link below (about a 40 meg download). It probably bears stating that I am in no way affiliated with vimeo.com. One of the forum members here suggested them for video hosting, and I've been pleased with their service thus far. If anyone has a better suggestion, I'm all ears.
But I have a request : anyone could help me to have the scrollview centered on the screen when I zoom out ? I tried all the day, but I think I'm not enough used to this langage to find a solution :( Thanks by advance :o
Hi, very nice tutorial. However, when I build and install this application onto the iphone. The pinching and zooming events are not always registered. The pinching gesture are sometimes registered as just tabs, any idea why?
I haven't installed this app to my phone to try it out. I'll do that a little later and see if I have the same problems.
Thanks for the reply. I have another question.
I have been trying to add the scroll view to a view controller class. I added the UIScrollViewDelegate to the definition of the view controller class, and assigned the scrollView's delegate to self (the view controller), and finally added -(UIView *)viewForZoomingInScrollView:(UIScrollView *)scrollView{ return myImage; } in the view controller implementation.
Everything compiles fine. However, when I run it, the image is loaded into the scrollview, but it does not respond to any touch events (no panning, pinching etc..) Any suggestions?
I don't have a clue about the second problem you're having. My advice is to make sure that you have everything set up properly. I've compiled and ran the sample code that I provided with the tutorial, and I'm having the same problem that you are with the multi-touch zooming not always registering properly. I'm going to have to play around with it some more to figure out what's wrong there. Unfortunately, I didn't test the code on my testing device before posting the tutorial.....however, I'm sure that the fix is rather simple. If anyone out there can shed some light on this, I'd really appreciate it.
I've compiled and ran the sample code that I provided with the tutorial, and I'm having the same problem that you are with the multi-touch zooming not always registering properly. I'm going to have to play around with it some more to figure out what's wrong there. Unfortunately, I didn't test the code on my testing device before posting the tutorial.....however, I'm sure that the fix is rather simple. If anyone out there can shed some light on this, I'd really appreciate it.
I'm pretty sure that you can lock the horizontal direction, but I haven't implemented it. Eventually, once I get caught up with school and work, I'll get back to this tutorial and answer some of the questions that people are asking........it's amazing how life gets in the way sometimes!
I'm pretty sure that you can lock the horizontal direction, but I haven't implemented it. Eventually, once I get caught up with school and work, I'll get back to this tutorial and answer some of the questions that people are asking........it's amazing how life gets in the way sometimes!
Oh, I hear ya man... I been having no time lately... So much college work:p
Oh, I hear ya man... I been having no time lately... So much college work:p
Tell me about it. I've got a full-blown project for an object-oriented programming class that I haven't even started and I've been promising that an update to To Do's will be out the first week of October. WHAT WAS I THINKING???!!!!
I'll be lucky to get anything finished in the next two or three weeks.....way too much going on and not enough time in the day! Oh well :)
Hello, im new to the forum and have a question about your scrollview tut. Can I just add a view to the scrollview, and have that view contain UIImages, and UIButtons? I think the answer is yes, but im having trouble getting things to work.
Can I place the scrollview in my xib and the view and its contents into the scrollview in that same xib?
In using the scrollview and getting different images, the images are "building up" so the scrollview is showing multiple images when the top image is pinched, zoomed and moved around.
How can I clean it out so there is only one image in the view?
it is interesting, but i have a question how can i dynamic cahnge image? for example i have a chess board, and user can add figures to the board how to make such application in this case? i can not just have an image of board, i have to change it every turn
I am developing an application which has buttons to navigate through the various views. My 1st view is a Registration page which has a ScrollView. On clicking the next button on this page, the next view is displayed. On clicking the Back button in this page the previous view is displayed but you can no longer Scroll as earlier.
This doesn't help me.. I'm still having issues. Can someone please post a video or instructions on how id do this in Xcode 4.2 and with adding a picture under resources not the way its done here. Ive been trying the last 3 days to get a pinch zoom working for a photo.. :( Thanks!!
This is a simple tutorial on how to add a UIScrollView to your project.
Unfortunately, the embedded versions of these videos from vimeo.com aren't in HiDef. To see them in HiDef, you'll either have to view them at vimeo.com or you can download a HiDef version to your computer with the link below (about a 40 meg download). It probably bears stating that I am in no way affiliated with vimeo.com. One of the forum members here suggested them for video hosting, and I've been pleased with their service thus far. If anyone has a better suggestion, I'm all ears.
Replies
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Disagree Dislike Like AwesomeBut I have a request : anyone could help me to have the scrollview centered on the screen when I zoom out ? I tried all the day, but I think I'm not enough used to this langage to find a solution :(
Thanks by advance :o
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Disagree Dislike Like AwesomeThanks
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Disagree Dislike Like Awesome- Spam
- Abuse
- Troll
0 • Off Topic Insightful Disagree Dislike Like AwesomeI have been trying to add the scroll view to a view controller class. I added the UIScrollViewDelegate to the definition of the view controller class, and assigned the scrollView's delegate to self (the view controller), and finally added
-(UIView *)viewForZoomingInScrollView:(UIScrollView *)scrollView{
return myImage;
}
in the view controller implementation.
Everything compiles fine. However, when I run it, the image is loaded into the scrollview, but it does not respond to any touch events (no panning, pinching etc..) Any suggestions?
Thanks
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Disagree Dislike Like Awesome- Spam
- Abuse
- Troll
0 • Off Topic Insightful Disagree Dislike Like AwesomeThanks
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Disagree Dislike Like Awesome- Spam
- Abuse
- Troll
0 • Off Topic Insightful Disagree Dislike Like Awesome- Spam
- Abuse
- Troll
0 • Off Topic Insightful Disagree Dislike Like Awesome- Spam
- Abuse
- Troll
0 • Off Topic Insightful Disagree Dislike Like AwesomeI'll be lucky to get anything finished in the next two or three weeks.....way too much going on and not enough time in the day! Oh well :)
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Disagree Dislike Like AwesomeYou can also take idea from....
iPhone Dev Center
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Disagree Dislike Like AwesomeFor example I want to have this code work in another view?
Create a new project called test and you get the app delegate .h and .m files as well as the testviewcontroller .h and .m files.
I am trying to get the scrollview to appear in the testviewcontroller files xib etc
but all the referencing in the tut is in the delegates code?
Any pointers?
Thanks
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Disagree Dislike Like AwesomeCan I place the scrollview in my xib and the view and its contents into the scrollview in that same xib?
Thanks
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Disagree Dislike Like AwesomeI'm having the same problem as elpuerco!
Any help would be greatly appreciated!
Thanks
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Disagree Dislike Like AwesomeIn using the scrollview and getting different images, the images are "building up" so the scrollview is showing multiple images when the top image is pinched, zoomed and moved around.
How can I clean it out so there is only one image in the view?
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Disagree Dislike Like Awesome{
//this gets an image from an SQLITE db
[self getBillPic];
initWithImage:billImage];
self.myImage = [[UIImageView alloc] initWithImage:billImage];
myScrollView.contentSize = CGSizeMake(myImage.frame.size.width, myImage.frame.size.height);
myScrollView.maximumZoomScale = 4.0;
myScrollView.minimumZoomScale = 0.75;
myScrollView.clipsToBounds = YES;
myScrollView.delegate = self;
[myScrollView addSubview:myImage];
}
- (UIView *)viewForZoomingInScrollView:(UIScrollView *)scrollView {
return myImage;
}
I placed this code in a ViewController. The UIScrollView in a XIB file
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Disagree Dislike Like Awesomehow can i dynamic cahnge image?
for example i have a chess board, and user can add figures to the board
how to make such application in this case? i can not just have an image of board, i have to change it every turn
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Disagree Dislike Like AwesomeEDIT: one issue tho, how do i put a scrollview into a viewcontroller?
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Disagree Dislike Like Awesome- Spam
- Abuse
- Troll
0 • Off Topic Insightful Disagree Dislike Like AwesomeI am developing an application which has buttons to navigate through the various views. My 1st view is a Registration page which has a ScrollView. On clicking the next button on this page, the next view is displayed. On clicking the Back button in this page the previous view is displayed but you can no longer Scroll as earlier.
Could anyone tell me why is it so?
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Disagree Dislike Like AwesomeThanks a lot!
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Disagree Dislike Like AwesomeThanks!!
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Disagree Dislike Like Awesome- Spam
- Abuse
- Troll
0 • Off Topic Insightful Disagree Dislike Like Awesome