SwiftUI NavigationLink Hide Arrow

放肆的年华 提交于 2019-12-21 05:07:39

问题


Is there a way to hide the arrow to the right of the navigation link view that is automatically added?

I want to show an image grid using NavigationView -> List -> HStack -> NavigationLink_1 - NavigationLink_2

The NavigationLinks have arrows and it looks weird


回答1:


@State var selection: Int? = nil

var body: some View {
    let navigation = NavigationLink(destination: Text("View"), tag: 1, selection: $selection) { EmptyView() }
    return 
        VStack { 
            navigation
            Text("Tap").onTapGesture { self.selection = 1 }
        }
}



回答2:


Try adding into a scroll view so that

ScrollView(.horizontal, showsIndicators: false)



来源:https://stackoverflow.com/questions/58333499/swiftui-navigationlink-hide-arrow

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!