1

This is a very simple question, really:

If I tell my UIScrollView to set its contentOffset to something like {0, 50}, then set it to {0, 100} a moment later, will its final position be y = 100, or y = 150?

I'm trying to get it to focus on certain fields in a table, and it's behaving unexpectedly, but I think if I know the answer to the question or whether the offset is absolute or relative, I can piece the rest together.

4

2 回答 2

4

From the documentation,

setContentOffset:animated:

Sets the offset from the content view’s origin that corresponds to the receiver’s origin.

- (Void) setContentOffset: (CGPoint) contentOffset animated: (BOOL) animated


--where contentOffset==>A point (expressed in points) that is offset from the 
content view’s origin.
于 2013-08-30T10:55:19.683 回答
1

Absolute. Apple's documentations says, that contentOffset is

The point at which the origin of the content view is offset from the origin of the scroll view.

于 2013-08-30T10:47:38.717 回答