2012-08-24 3 views
2

UIViewUIScrollView이 있습니다. pagingEnabled 모드에서 UIScrollView을 사용하고 있습니다. 나는 사용자가 동시에 양방향으로 스크롤하는 것을 허용하고 싶지 않다. 내 말은, 사용자가 가로로 스크롤하기 시작하면 세로 스크롤을 비활성화하고 그 반대도 마찬가지이다. 나는 그것을 어떻게 성취 할 수 있는가?사용자가 가로로 스크롤하는 동안 세로 스크롤을 사용 중지하는 방법은 무엇입니까?

감사합니다.

답변

6

directionalLockEnabled A Boolean value that determines whether 
scrolling is disabled in a particular direction 

@property(nonatomic, getter=isDirectionalLockEnabled) BOOL 
directionalLockEnabled Discussion If this property is NO, scrolling is 
permitted in both horizontal and vertical directions. If this property 
is YES and the user begins dragging in one general direction 
(horizontally or vertically), the scroll view disables scrolling in 
the other direction. If the drag direction is diagonal, then scrolling 
will not be locked and the user can drag in any direction until the 
drag completes. The default value is NO 

Availability Available in iOS 2.0 and later. Declared In 
UIScrollView.h 
있는 UIScrollView

의 특성 directionalLockEnabled를 사용하려고
관련 문제