How to stop a UILabel scrolling? - iphone

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.

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

iPhone - scrollview with a textview and tableview inside

I have an interface which will have a text view and a table view below it. My current view looks like this
UIScrollView
UITextView
UITableView
Currently the TextView and TableView can scroll vertically..but what i want is the whole screen to scroll up/down. Why doesn't this work properly?
You can put a TableView inside a ScrollView, but you must resolve conflicts between touches, scrolling, and bouncing in IB or with code, and you must set the ScrollView's contentSize with code, not in IB.
If the TextView really "belongs" to the table, consider putting it in a table cell, or better, as a header, that's what they're for.

label and scroll view

HI FRIENDS..
I use a scroll view and a label now i want that when i scroll that , label also scroll with that and set to next location , i set paging enable = YES , so i want that there are 5 images and when i did scrolling the label i set is also move and show in other position.
thanks
To scroll a UILabel (or anything for that matter) WITH a UIScrollView, simply add the label to the UIScrollView.
You can easily do this in Interface Builder by the obvious methods.
You can also do this programmatically by utilizing the addSubview: method.
You can do one thing you change frame of label when you scroll in delegate method of scrollview or you can also make 5 same label in all 5 pages.
Good Luck
Well if you have added a scrollview on top of a uiview you can add that label on the view and then bring it to front. then you dont have to worry about changing frame of the uilabel as it will be always on top of the scrollview and at the same position and also you can change the text of that label when the user scrolls in pagecontrol value changed method.

iPhone: UIScrollView not scrolling when adding item via IB

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?

Prevent subview from scrolling in a UIScrollView

I have a UIScrollView subclass with a certain subview I'd like to prevent from scrolling (while all the other subviews scroll as normal).
The closest example to this I can think of is UITableView's "index strip" on the right side (look in the Contacts app to see an example). I am guessing this is a subview of the table (scrollview) but it does not move as the user scrolls.
I can't seem to make my subview stay put! How can I accomplish this?
The trick is to adjust the frame of the "non-scrollable" subview inside -layoutSubviews.
Add the view that you want not to move as a sibling view of the scroll view on top of the scroll view instead of as a subview.
You can set it's property called userInteractionEnabled to NO