Swift/Swift 개발 노트
[SwiftUI] 기울어지게 배치하기
힛해
2024. 3. 30. 21:26
728x90
ZStack {
VStack{
Text("\(index + 1)").foregroundColor(index < 3 ? .white : Color(hex: "3D3D3D")).fontWeight(.bold).font(.system(size: 130))
}
.frame(width : 190 , height: 190)
.background(
index < 3 ?
LinearGradient(colors: [numberTop[index % 3] ,numberBottom[index % 3]], startPoint: .top, endPoint: .bottom) : LinearGradient(colors: [numberTop[3] ,numberBottom[3]], startPoint: .top, endPoint: .bottom)
)
.cornerRadius(60)
.rotationEffect(.degrees(-28)).offset(x:120,y:-30)