struct menu : View{
@State private var isActive : Bool = false
var rowActive : Bool
@Binding var size : CGFloat
var body : some View{
VStack{
HStack{
Spacer()
Button(action: {
self.size = UIScreen.main.bounds.width / 1.6
}) {
Image("closed").resizable().frame(width: 15, height: 15).padding()
}
.clipShape(Circle())
// .padding()
}
ZStack{
Image("IMG_0410")
.resizable()
.frame(width: 70, height: 70)
.clipShape(Circle())
.padding(.horizontal,24)
Circle()
.stroke(Color("mono_blue"))
.frame(width: 70, height: 70)
.offset(x:-2, y:-1)
Circle()
.stroke(Color("new_blue"))
.frame(width: 70, height: 70)
.offset(x:2, y:1)
}.padding()
.padding()
HStack{ `This one Button needs to be made working`
Image("about").resizable().frame(width: 18, height: 18).padding()
Text("About").fontWeight(.medium)
.foregroundColor(rowActive ? Color("darker") : .white)
Spacer()
}.padding(-4)
.background(rowActive ? Color.white: Color.white.opacity(0))
.padding(.trailing, 20)
.clipShape(RoundedRectangle(cornerRadius: 20, style: .continuous))
.offset(x: 20)
.padding(.bottom)
HStack{ `This one Button needs to be made working`
Image("award").resizable().frame(width: 20, height: 20).padding()
Text("Achievements").fontWeight(.medium)
.foregroundColor(rowActive ? Color("darker") : .white)
Spacer()
}.padding(-4)
.background(rowActive ? Color.white: Color.white.opacity(0))
.padding(.trailing, 20)
.clipShape(RoundedRectangle(cornerRadius: 20, style: .continuous))
.offset(x: 20)
.padding(.bottom)
HStack{ `This one Button needs to be made working`
Image("emergencies").resizable().frame(width: 23, height: 23).padding()
Text("Emergency").fontWeight(.medium)
.foregroundColor(rowActive ? Color("darker") : .white)
Spacer()
}.padding(-4)
.background(rowActive ? Color.white: Color.white.opacity(0))
.padding(.trailing, 20)
.clipShape(RoundedRectangle(cornerRadius: 20, style: .continuous))
.offset(x: 20)
.padding(.bottom)
// Divider()
HStack{ `This one Button needs to be made working`
Image("feedback").resizable().frame(width: 23, height: 23).padding()
Text("Send feedback").fontWeight(.medium)
.foregroundColor(rowActive ? Color("darker") : .white)
Spacer()
}.padding(-4)
.background(rowActive ? Color.white: Color.white.opacity(0))
.padding(.trailing, 20)
.clipShape(RoundedRectangle(cornerRadius: 20, style: .continuous))
.offset(x: 20)
.padding(.bottom)
HStack{ `This one Button needs to be made working`
Image("help").resizable().frame(width: 23, height: 23).padding()
Text("Help").fontWeight(.medium)
.foregroundColor(rowActive ? Color("darker") : .white)
Spacer()
}.padding(-5)
.background(rowActive ? Color.white: Color.white.opacity(0))
.padding(.trailing, 20)
.clipShape(RoundedRectangle(cornerRadius: 20, style: .continuous))
.offset(x: 20)
.padding(.bottom)
Divider()
Spacer()
}.frame(width: UIScreen.main.bounds.width / 1.6)
.background(LinearGradient(gradient: Gradient(colors: [Color("mono_blue"), Color("light_grey")]), startPoint: .leading, endPoint: .trailing))
}
}
Как мне заставить эти кнопки работать. Вот код для представления, которое используется как боковое меню в моем проекте. Когда я использую NavigationLink, добавляя NavigationView, только в области представления меню, он меняется на другой вид. Я хочу перейти на другой экран с помощью кнопки бокового меню. Я хочу, чтобы весь экран перемещался в другой вид.