iPhone: UIScrollView not scrolling when adding item via IB - iphone

I'm trying to make a very simple scrolling page via IB. What I've got is a UIImageView at the top and 2 UIImageViews at the bottom, with a UITextView in the middle. I've disabled the scrolling in the UITextView as I won't the whole page to scroll up and down including the UIImageViews.
Can anyone tell me why the UIScrollView won't scroll up and down? All of the items above are subviews of UIScrollView via IB.

You can only scroll in a UIScrollView if the contentSize is larger than the frame. Have you set this?

Related

iPhone: Make UIScrollView from UIView

I have a UIView with labels and textfields and I tested it in the simulator and noticed that I cannot scroll to see the rest of the view, how can I make the view into a UIScrollView and what do I need to do so I can make the view scrollable? I don't want to move labels and stuff or delete the UIView, is there a simple way?
Take a UIScrollView in Xib file outside your view. drag your view into this scrollview. The subviews inside your view remains same. and set the scrollview's contentSize

scrolling some part of UIScrollView

I am developing an app. In which we are placing UIScrollView and buttons & images on UIScrollView.Images are at the bottom of the UIScrollView and Buttons are at top of the UIScrollView.
Problem is that I want to scroll only images not buttons. Is it possible to scroll only some part in UIScrollView. If possible how can we achieve it.
Any one can help or suggest with links.
Instead of putting the buttons on the UIScrollView, make the UIScrollView smaller and add the buttons to the same parent view as the UIScrollView.
You can take another scrollview and add images on it. So that if you scroll the images your buttons will not move.
Create 2 scrollviews, one for button & one for images. Then set scrolling disabled for the one with buttons.

How to add a separator between UIImageViews in UIScrollView and keep the paging scroll height 480?

I have a UIScrollView that contains 2 UIImageViews. I turn on the pagination properties and am able to scroll vertical pages (480). Now I want to add another UIImageView that will act as separator between the images and keep the vertical scrolling height. Means that every time I'll scroll, I'll see the separator but stop on the full image. Thanks.
This UIView method might do the trick: hitTest:withEvent:See UIScrollView Custom Paging

How to stop a UILabel scrolling?

I have several UILabels. I setup a UIScrollView within a app that works fine. The problem that I'm having is I want some UILabels to scroll and some to remain frozen. I don't think this is a coding problem as much as a interface builder issue.
If you mean you want the labels to be fixed on top of the scrollview, then simply drag them out in interface builder so they're at the same level in the hierarchy and not inside of the scrollview.
You can simply add the UILabel as subView of scrollView which you want to scroll. And add the UILabel as subView of self.view which you dont want to scroll.

Moving UIButton from UIScrollView to UIView in iPhone SDK

I am stuck with a problem actually the scene is like this in my view controller i have place several buttons which i can move within the view now in same view half of the screens is occupied by uiscrollview in this scrollview also i have several uibuttons which i want to move from uiscrollview to uiview Now when i try to move uibutton from uiscrollview to uiview it hides as it moves from the scrollview similarly as i move uibutton from uiview to uiscrollview then also it hides as my drag reaches the scrollview area.
Please help me out with this problem
Thanks in advance....
Your UIButtons each have a superview. For the UIButtons in the scrollview, the UIScrollView is the superview. When you have scrollView.clipsToBounds == YES, then the UIButtons in the scrollview will become obscured if you move them outside of the visible area of the scrollview.
There are several possible solutions, including:
Add code to change the superview of the UIButtons once they reach the edge of the scrollview (but this is tricky, and I wouldn't do it unless there was an easier option, check out Apple's UIView documentation, especially (UIView)removeFromSuperview and (UIView)addSubview:). You would have to perform this switch of superview in the code that moves the button (or tracks the move).
Add the UIButtons to a UIView which is the parent of the scrollview, maybe even your viewcontroller.view (but your UIButtons in the scrollview will no longer move with the scrollview upon scrolling). You would add the buttons to the view behind the scrollview, but so that they show above it.