views:

151

answers:

3

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?

A: 

You can set it's property called userInteractionEnabled to NO

dusker
No. This will stop the entire scrollview from scrolling. Instead, I'm trying to stop *one* of the scrollview's subviews from moving while everything else scrolls.
jbrennan
A: 

The trick is to adjust the frame of the "non-scrollable" subview inside -layoutSubviews.

jbrennan
A: 

Uh, how, exactly? I dont get it

Bohrier