[iOS] frame과 bounds의 차이

유인호·2024년 1월 9일
0

iOS

목록 보기
13/64

기존 지식

frame은 본인 뷰의 크기, bounds는 기기의 크기라고 알고 있었음.


조사해보니

1. Frame

  • The frame rectangle, which describes the view’s location and size in its superview’s coordinate system.

2. Bounds

  • The bounds rectangle, which describes the view’s location and size in its own coordinate system.

=>
Frame은 부모(슈퍼)뷰를 기준으로 크기와 위치를 반환하고, Bounds는 자기 자신을 기준으로 크기와 위치를 반환한다.


Bounds가 잘 안보이긴 한데, x,y가 0,0이라 가운데에 위치해 있는걸 알 수 있다.

profile
🍎Apple Developer Academy @ POSTECH 2nd, 🌱SeSAC iOS 4th

0개의 댓글