SwiftUI NavigationButton without the disclosure indicator?

前端 未结 16 976
不知归路
不知归路 2020-12-02 12:04

When making a List with a row that pushes to a new view, SwiftUI adds a disclosure indicator \">\" automatically? How do I remove it if I don\'t want it?

            


        
16条回答
  •  盖世英雄少女心
    2020-12-02 12:44

    What you can do, if you are using list, is setting the navigationlink to hidden and its frame width to zero.

        HStack{
                Button(action: {self.statusShow = 1}, label: {
                    Image(systemName: "info.circle")
                })
                NavigationLink(destination: StimulatorSettingView(),
                               tag: 1,
                               selection: self.$statusShow){
                                EmptyView()
    
                }.hidden().frame(width: 0)
            }
    

    This worked for me.

提交回复
热议问题