Reputation: 2662
I'm trying to create a screen in SwiftUI. In that I'm facing some issues, Like:
NavigationButton
is not working in the navigationBarItems
.Code:
struct ContactDetailView : View {
var body: some View {
VStack {
ContactDetailHeaderView()
.edgesIgnoringSafeArea(.top)
.frame(height: UIDevice.screenWidth*0.8)
.listRowInsets(EdgeInsets())
.background(LinearGradient(gradient: Gradient(colors: [AppColors.white, AppColors.themeGreen.opacity(0.6)]), startPoint: .top, endPoint: .bottom), cornerRadius: 0)
ContactDetailRow(title: "Mobile", description: "+91 1248932410") //View for creating row
ContactDetailRow(title: "Email", description: "[email protected]") //View for creating row
}
.navigationBarItems(trailing:
NavigationButton(destination: AddContactView()) {
Text("Edit")
.font(AppFonts.Regular.withSize(17.0))
.foregroundColor(AppColors.themeGreen)
}
)
}
}
If any one got some idea in that please help. Thank you in advance.
Upvotes: 0
Views: 227