Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

solinari6

macrumors regular
Original poster
Aug 13, 2008
101
16
Hi, so I've got an issue I can't quite figure out, and am looking for advice.

I've got a textview, that is on a scrollview. The textview is only a small part of the scrollview, and I've set the height of the textview to have enough room for around 3 lines of text. BUT, the textview can have much more than that, and should scroll to show the rest.

The problem is, when I try to scroll the textview, it just scrolls the whole scrollview. I don't know what's wrong ... I definitely have scrolling enabled on the textview.

Any ideas?
 
I would detect when textview is active.

Code:
-(void)textFieldDidBeginEditing:(UITextField *)textField { //Keyboard becomes visible
 // Disable Scrollview ! //
    //perform actions.
}
or


Code:
if (textFieldSomething.isEditing) {
    ...
}

then re-enable it when they press else where to scroll.
Just how I would do it.
 
I'm not sure I follow ... it isn't an editable field.. so it shouldn't have any keyboard showing up when they click on it.
 
Scrolling might be enabled but most likely the ParentScrollView is most likely canceling any swipe gestures. It would assume that it should be the only thing handling swipes so can cancel them.

Either change the layout so top scroll view works with horizontal swipes leaving vertical for the textView. So neither compete for gestures or

Or there might be a way to get the scrollview to pass on the swipe events and ignore them itself while in the region of the textView but it's not something i've tried so can't help you other than to say.

Look at the Apple documents of Responder Chain for more on gestures and how they are handled.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.