UITableView Scroll w/ keyboardWillShow - iphone

I have uitableview scrolling upwards when keyboardWillShow event occurs. tableview is 320x148 and placed at the bottom of the uiview. When a user selects the first uitextfield, nsnotifcation is fired and moves the textfield accordingly.
My problem is, I have a label and logo in the background (uiview) that i want to see move upwards with the "event". I can do this with an animation, but it's not the desired effect.
My guess is to somehow make uiview move with uitableview somehow. Hope that makes sense.

Humm, i think you could put your UITableView inside a UIScrollView. When the UITableView scrolls, you could do the same to the UIScrollView behind..

Related

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.

Picker in a ScrollView doesn't scroll

I have a UIScrollView, inside it, a small UIView containing a UIPickerView.
I'm able to scroll the view up and down but whenever I try to scroll the picker, it scrolls the view instead. I can change the picker's value by clicking it but not scrolling.
Any ideas?
EDIT: I just tried scrollView.canCancelContentTouches = NO; but it only works when I first Touch and then Drag, as in the TouchesBegan event. The scrollView still scrolls if I touch-move the Picker as in the TouchesMoved event.
What can I do to give my Picker its natural behavior in a ScrollView?
You've already got canCancelContentTouches set to NO, but try setting delaysContentTouches to NO as well.

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

Second UIScrollView responding when using a UIScrollView

This is more of a check as I believe this is right but its a lot of work if I'm wrong.
I want to basically achieve fixed positioning with a scrollView. I want to have a list along the top that is always visible, scrolls horizontal only and then a scrollview beneath that to move around the information which scrolls both vertically and horizontally.
I figure I need to subclass UIScrollView and overwrite touchesBegan, touchesMoved and touchesEnded to send the touch to both UIScrollViews.
Is this right or off track?
Cheers
Overriding the touch events on a scroll view is probably not what you want to do. Instead you can simply use a single scroll view, and then in the parent view's -layoutSubviews or in the scroll view's delegate methods you can move the list so it's always at the same vertical position (use the scroll view's contentOffset property to determine where that should be). Both the delegate method and -layoutSubviews is called before the drawing actually occurs after the scroll view scrolls, so by always repositioning your view where you want it to be, it will appear to remain fixed to the user.

Scroll view touch detection

I have a problem in the touchesMoved handler with a view that is added onto a UIScrollView. I add a number of labels to the scroll view. Each of these labels contain some text and, on swiping my finger on the labels, I have to play a specific file for that text.
If I just add the view onto the window directly, I get all of the touch events in touchesMoved without any problem. When I add my view onto the UIScrollView and then add this to the window, there is some lag in the touchesMoved handler. I am not getting continuous touch points in touchesMoved as with the normal view. As a result, while swiping the finger from the view, it happens that some labels are missed.
Is the problem due to scroll view? The same code runs perfectly in normal conditions (without a scroll view).
Does anyone have any solution to this?
UIScrollView sets a timer on touchDown to be able to know if it should handle scrolling or if it should pass the events on to subviews.
There is a property on UIScrollView for controlling this behaviour:
#property(nonatomic) BOOL delaysContentTouches