티스토리 뷰

영어 공부와 iOS 공부를 위해서 apple 개발자 문서를 번역한것입니다. 

공부하는 중에 번역한 것이라서 오타나, 잘못된 부분이 있을 수 있습니다.


https://developer.apple.com/library/content/documentation/UserExperience/Conceptual/AutolayoutPG/AutoLayoutWithoutConstraints.html#//apple_ref/doc/uid/TP40010853-CH8-SW1

Auto Layout Without Constraints

제약사함이 없는 auto layout

Stack views provide an easy way to leverage the power of Auto Layout without introducing the complexity of constraints. A single stack view defines a row or column of user interface elements. The stack view arranges these elements based on its properties.

스택뷰(쌓여진 형태의 뷰)는 제약 사항의 복잡함을 소개하지 않고 오토레이아웃의 힘을 활용할 수 있는 쉬운 방법을 제공한다. 하나의 단순 스택뷰는 사용자 인터페이스 요소의 하나의 열 또는 행을 정의한다. 스택뷰는 그것의 속성을 기반으로 이러한 요소를 정렬한다.

  • axis: (UIStackView only) defines the stack view’s orientation, either vertical or horizontal.

  • orientation: (NSStackView only) defines the stack view’s orientation, either vertical or horizontal.

  • distribution: defines the layout of the views along the axis.

  • alignment: defines the layout of the views perpendicular to the stack view’s axis.

  • spacing: defines the space between adjacent views.

  • axis(축): 스택뷰의 일반적 위치 또는 수직, 수평을 정의한다. 

  • orientation(일반적 위치, 정위): 스택뷰의 일반적 위치 또는 수직, 수평 정의

  • distribution(배분): 축을 따라서 뷰들의 레이아웃을 정의한다. 

  • alignment(정렬): 스택뷰의 축에서 뷰들의 레이아웃을 수직으로 정의한다.

  • spacing(공간): 인근의 뷰들 사이의 공간을 정의한다.


To use a stack view, in Interface Builder drag either a vertical or horizontal stack view onto the canvas. Then drag out the content and drop it into the stack.

인터페이스 빌더에서 스택뷰를 사용하기 위해서는 캔버스에 수직 또는 수평의 스택뷰를 드래그한다.  그리고 내용을 드래그하여 빼고, 그 스택안에 그것을 떨어뜨린다.

If an object has an intrinsic content size, it appears in the stack at that size. If it does not have an intrinsic content size, Interface Builder provides a default size. You can resize the object, and Interface Builder adds constraints to maintain its size.

만약 하나의 객체가 고유한 내용의 사이즈를 갖고 있다면, 그것은 그 스택에 그 사이즈로 나타난다. 만약 고유한 사이즈를 갖지 않는 다면, 인터페이스 빌더는 기본 사이즈를 제공한다. 당신은 그 객체의 사이즈를 조정 할 수 있고, 인터페이스 빌더는 그것 사이즈를 유지하기위한 제약 사항을 추가한다.

To further fine-tune the layout, you can modify the stack view’s properties using the Attributes inspector. For example, the following example uses an 8-point spacing and a Fills Equally distribution.

더욱이 미세한 조정을 위해서, 당신은 어트리뷰트 인스펙터(속성을 편집하는 도구)를 이용해 스택뷰의 속성을 수정할 수 있다. 예를 들어서, 다음의 예시는 8 포인트의 공간과 동등하게 분산하여 채우기를 사용한다.

image: ../Art/IB_StackView_Simple_2x.png

The stack view also bases its layout on the arranged views’ content-hugging and compression-resistance priorities. You can modify these using the Size inspector.

스택뷰는 그것의 레이아웃 위에 정렬된 뷰들의 콘텐트-포함과 요약-저항의 우선순위의 기반이다. 당신은 크기 인스펙터를 이용해 이것들을 수정할 수 있다.  

Additionally, you can nest stack views inside other stack views to build more complex layouts.

추가적으로, 당신은 복잡한 레이아웃을 위해 하나의 스택뷰 안에 다른 스택뷰를 놓을 수 있다. 

image: ../Art/IB_StackView_NestedStacks_2x.png

In general, use stack views to manage as much of your layout as possible. Resort to creating constraints only when you cannot achieve your goals with stack views alone.

일반적으로, 관리를 위해 가능한 많이 스택뷰를 사용한다. 하나의 스택뷰 만으로 당신의 목표를 달성할 수 없을때만 제약사항을 생성하는하는 것에 의지해라.

For more information on using stack views, see UIStackView Class Reference or NSStackView Class Reference.

스택뷰를 사용하기 위한 더 많은 정보는 UIStackView Class Reference 또는 NSStackView Class Reference를 보면된다.


댓글
공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
링크
TAG
more
«   2024/05   »
1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31
글 보관함