반응형

 

Hacking with Swift 사이트의 강좌 번역본입니다.

 

[원문 : https://www.hackingwithswift.com/quick-start/swiftui/how-to-adjust-the-accent-color-of-a-view]

 

How to adjust the accent color of a view

 

iOS는 tint 색상을 사용해서 앱에 공동으로 적용할 수 있는(coordinated) 테마를 제공하고, SwiftUI 에서는 accent colors라는 이름으로 동일한 기능을 사용하는게 가능합니다. UIKit 처럼, 뷰의 강조(accent) 색상을 설정할때, 뷰 내부에 모두 적용되므로, 상위 레벨의 컨트롤에 색상을 설정하는 경우, 모두 그 색상이 칠해집니다.

 

예를들어, 다음은 VStack 내부에 버튼을 만들고, 강조 색상을 오렌지 색으로 주었습니다.

VStack {
    Button(action: {}) {
        Text("Tap here")
    }
}.accentColor(.orange)

 

반응형

'개발 > SwiftUI' 카테고리의 다른 글

How to adjust views by tinting, and desaturating, and more  (0) 2019.11.28
How to blend views together  (0) 2019.11.28
How to blur a view  (0) 2019.11.27
How to mask one view with another  (0) 2019.11.27
How to adjust the opacity of a view  (0) 2019.11.27
How to round the corners of a view  (0) 2019.11.27
How to scale a view up or down  (0) 2019.11.27
How to rotate a view in 3D  (0) 2019.11.27
Posted by 까칠코더
,