how can I add a border with a cornerRadius
to an Image. I get a deprecation warning saying that i should use a RoundedRectange Shape, but i don\'t know how to use t
Write a rounded text view which is same with Image View
struct RoundedTextView: View {
var body: some View {
Text("Rounded Text View")
.frame(width: 200, height: 200, alignment: .center)
.foregroundColor(.white)
.background(Color.blue)
.cornerRadius(16)
.overlay(
RoundedRectangle(cornerRadius: 16).stroke(Color.yellow, lineWidth: 8)
)
}
}
Preview like this image: