SwiftUI NavigationButton without the disclosure indicator?

前端 未结 16 938
不知归路
不知归路 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条回答
  •  萌比男神i
    2020-12-02 12:37

    just came here looking for the answer to this question, but none of the proposed solutions worked for me (can't have an empty view, because i want to put something in the list row; i'm already messing with the padding (and increasing trailing padding didn't seem to work) ... i was about to give up, and then something occurred to me: what if you crank up the z-index of the list row itself? seemed somewhat unlikely, but i gave it a try and, i'll be damned, it worked! i was so pleasantly surprised, i felt like sharing ...

    e.g.:

    // in body of your list row view
    HStack(alignment: .top, spacing: 0.0) {
        // stuff ...
    }
    .zIndex(9999999999)
    

提交回复
热议问题