When I add .navigationBarItems modifier list is clipping and doesn't take all space like this
It should be like on this photo (without .navigationBarItems):
Code
struct PatientsListView: View {
@ObservedObject var listData = PatientsListViewModel()
var body: some View {
NavigationView{
Group {
if listData.patientsList.count > 0{
List{
ForEach(Array(listData.patientsList)) { patient in
NavigationLink(destination: PatientsDetailView(patient: patient),
label: {
PatientsListRow(patient: patient)
})
}
}
}
else if listData.patientsList.count == 0 {
Text("Самое время добавить пациентов!").foregroundColor(.gray)
}
else if listData.isLoading {
ProgressView()
}
}
.navigationTitle("Пациенты")
.navigationBarTitleDisplayMode(.large)
.navigationBarItems(trailing: NavigationLink(destination: PatientCreateView(), label: {
Image(systemName: "plus").foregroundColor(.white)
}))
}
.onAppear(perform: {
listData.fetchPatients()
})
}
}