contentInset
하위뷰 콘텐츠의 상하좌우로 안쪽 여백을 주는 것입니다. (바깥쪽 x)
https://developer.apple.com/documentation/uikit/uiscrollview/1619406-contentinset
contentInset - UIScrollView | Apple Developer Documentation
Instance Property contentInset The custom distance that the content view is inset from the safe area or scroll view edges. DeclarationDiscussionUse this property to extend the space between your content and the edges of the content view. The unit of size i
developer.apple.com
예제
scrollView.contentInset = UIEdgeInsets(top: 10, left: 10, bottom: 10, right: 10)
contentOffset
Bounds의 Origin Point입니다. 즉 x, y좌표를 의미하는 것으로 ScrollView에서 스크롤과 동시에 ContentOffset이 변하는 것입니다.
(ContentOffset이 변하면 스크롤됨)
https://developer.apple.com/documentation/uikit/uiscrollview/1619404-contentoffset
contentOffset - UIScrollView | Apple Developer Documentation
Instance Property contentOffset The point at which the origin of the content view is offset from the origin of the scroll view. Declarationvar contentOffset: CGPoint { get set } Discussion
developer.apple.com
예제
scrollView.contentOffset = CGPoint(x: 0, y: 20)
'iOS' 카테고리의 다른 글
Podfile.lock을 git commit시 포함해야하는가? (0) | 2020.06.14 |
---|---|
iOS 오픈소스 첫 배포 (1) | 2020.03.01 |
[iOS] CALayer란 (1) | 2020.02.23 |
[iOS] 앱 패키지 내부 살펴보기 (0) | 2020.02.22 |
Xcode 컴파일 최적화하여 빌드 속도 올리기 (1) | 2020.01.19 |