티스토리 뷰
RoundedRectangle 사용시 border 컬러와 fill 컬러를 다르게 사용하고 싶은 경우,
참고로 RounedRectangle에서 .fill 과 .stroke를 함께 사용할 수 없다.
아마도 서로 대치되는 개념이기 때문에 함께 사용하지 못하는 것 같다.
import SwiftUI
struct ContentView: View {
var body: some View {
RoundedRectangle(cornerRadius: 25)
.fill(Color.green)
.frame(width: 100, height: 100)
.overlay(
RoundedRectangle(cornerRadius: 25)
.stroke(Color.blue, lineWidth: 4)
)
}
}
struct ContentView_Previews: PreviewProvider {
static var previews: some View {
ContentView()
}
}
.background(.ultraThickMaterial, in: RoundedRectangle(cornerRadius: 5))
.overlay {
RoundedRectangle(cornerRadius: 5, style: .continuous)
.stroke(.gray, lineWidth: 1)
.opacity(0.1)
}
반응형
공지사항
최근에 올라온 글
최근에 달린 댓글
- Total
- Today
- Yesterday
TAG
- 상품 등록
- 문자 자르기
- MainActor
- 특정 문자를 기준으로 자르기
- .submit()
- 제품 등록
- FileUpload
- System.Diagnostics
- 아이폰
- Task
- App Store
- trim
- 공백제거
- async
- 앱 스토어
- 진수 변환
- mssql
- 명령어
- await
- nl2br
- hyper-v
- html tag
- system.io
- In App Purchase
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
글 보관함