본문 바로가기

iOS

[Swift UI] Circle button 만들기

반응형

일반적인 버튼을 만든 뒤, Text 로 투명한 버튼을 가리고 원형처럼 보이게 만든다.

 

Button(action: {
    print("Round Action")
    }) {
        Text("Press")
        .padding(0.0)
        .frame(width: 50, height: 50
        )
        .foregroundColor(Color.white)
        .background(Color.gray)
        .clipShape(Circle())
    }