Код: Выделить всё
var body: some View {
Map(coordinateRegion: .constant(region))
.frame(height: UIScreen.main.bounds.width * 0.7)
.frame(maxWidth: .infinity)
}
Я также пытался добавить кнопку над этой кнопкой, но по какой -то причине он все еще закончился. src = "https://i.sstatic.net/jpmde4r2.png"/>
Код: Выделить всё
var body: some View {
ZStack(alignment: .bottomTrailing) {
Map(coordinateRegion: .constant(region))
.frame(height: UIScreen.main.bounds.width * 0.7)
.frame(maxWidth: .infinity)
Button {
print("Tapped")
} label: {
Image(systemName: "car.fill")
.padding()
.background(.white)
.tint(.secondary)
.clipShape(Circle())
.shadow(color: .black.opacity(0.7), radius: 6, x: 0, y: 2)
}
}
}
Подробнее здесь: https://stackoverflow.com/questions/797 ... in-swiftui