Mercurial > public > geoquiz
view GeoQuiz/Helpers/AnswerButton.swift @ 7:d945e52b0704
implement dynamic map
author | Dennis C. M. <dennis@denniscm.com> |
---|---|
date | Tue, 04 Oct 2022 18:54:24 +0200 |
parents | 1946bbfde4af |
children | e09959b4e4a8 |
line wrap: on
line source
// // AnswerButton.swift // GeoQuiz // // Created by Dennis Concepción Martín on 14/9/22. // import SwiftUI struct AnswerButton: View { let optionName: String let color: Color var body: some View { RoundedRectangle(cornerRadius: 15) .foregroundStyle(.regularMaterial) .overlay( Text(optionName) .font(.title2.bold()) .foregroundColor(color) ) } } struct AnswerButton_Previews: PreviewProvider { static var previews: some View { ZStack { LinearGradient(gradient: .main, startPoint: .top, endPoint: .bottom) .ignoresSafeArea() VStack { Spacer() AnswerButton(optionName: "Madrid", color: .royalLightBlue) .frame(height: 70) } .padding() } } }