SwiftUI NavigationButton without the disclosure indicator?

前端 未结 16 969
不知归路
不知归路 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:38

    You can also put it in the .background modifier:

    List {
        Text("Go to...")
            .background(NavigationLink("", destination: Text("Detail View")))
    }
    

    If you already have the background modifier on the Text, you can wrap the Text in a HStack and apply background to the HStack.

提交回复
热议问题