Post

Replies

Boosts

Views

Activity

Reply to NavigationView issues after displaying a sheet view in the second screen
I already have that on my NavigationView. Still no change in behavior. Below is what I have for my NavigationView. NavigationView {       ZStack {         if items.isEmpty {           VStack {             Text(NO_ITEMS_TEXT).foregroundColor(TEXT_COLOR)             Text(ADD_ITEM_INSTRUCTION_TEXT).foregroundColor(TEXT_COLOR)           }           .frame(width: 400, height: 700)         } else {           List {             ForEach(items, id: \.self) { (item: Item) in               NavigationLink(destination: DetailView(item: item)) {                 Button(action: {                   showItemDetail = true                 }) {                   HStack {                     Text(item.wrappedName)                       .font(.title3)                       .foregroundColor(TEXT_COLOR)                   }.frame(width: UIScreen.main.bounds.size.width - 50, height: 50)                 }.padding(.trailing, -40)               }               .isDetailLink(true)               .swipeActions(edge: .trailing) {                 Button(role: .destructive,                     action: {                       self.deleteItem(item: item)                     }                 ) {                   Image(systemName: "trash")                 }               }             }             .id(UUID())           }           .listStyle(PlainListStyle())         }                   // Floating button         VStack {           Spacer()           HStack {             Spacer()                             Button(action: {               isPressed = true               DispatchQueue.main.asyncAfter(deadline: .now() + 0.1) {                 isPressed = false               }             }, label: {               Image(systemName: "plus")                 .font(.system(.largeTitle))                 .frame(width: 30, height: 30)                 .foregroundColor(Color.white).padding()             })             .background(Color.blue)             .cornerRadius(50)             .padding()             .shadow(color: Color.black.opacity(0.3), radius: 3, x: 3, y: 3)             .scaleEffect(isPressed ? 0.7 : 1.0)             .animation(Animation.spring(response: 0.3, dampingFraction: 0.5), value: isPressed)           }         }       }     }     .navigationViewStyle(.stack)
Feb ’22