SwiftUI NavigationButton without the disclosure indicator?

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

    When using List() there is no way to remove disclosure indicator without workarounds. However there is another easy way to do want you want to do, without List(). Instead of a List(), you can use an ScrollView() which has a ForEach() in it.

    It is neither harder nor more time-consuming, But it makes disclosure indicators of a NavigationLink disappear with no trick or workarounds, at no additional cost! letting you easily navigate to another view with a nice normal button.

提交回复
热议问题