Quantcast
Channel: Active questions tagged listview - Stack Overflow
Viewing all articles
Browse latest Browse all 611

Disclosure indicator in list in swiftui

$
0
0

enter image description here

This picture shows a list view. I want to hide the default disclosure indicator that appears when I use a navigation link. Additionally, the navigation link is causing the list view's color to change. I want to hide the disclouser button and I don't want to modify the color of the list cell. How to do this?

import SwiftUIstruct CurrencyHistoryView: View {    @State private var textHeight: Double = 20    let listRowPadding: Double = 5 // This is a guess    let listRowMinHeight: Double = 65 // This is a guess    var listRowHeight: Double {        max(listRowMinHeight, textHeight + 2 * listRowPadding)    }    var dataArray: [CurrencyData] = [        CurrencyData(date: "Room Rent", currency: "10000"),        CurrencyData(date: "School Fee", currency: "6000"),        CurrencyData(date: "Transport", currency: "2200"),        CurrencyData(date: "Food", currency: "4300"),        CurrencyData(date: "Electric city bill", currency: "2700"),        CurrencyData(date: "Fuel", currency: "2600"),        CurrencyData(date: "Extra", currency: "1900")    ]    var body: some View {        GeometryReader { _ in            ZStack {                Color.black                    VStack {                        List {                            Section {                                ForEach(dataArray) { array in                                    NavigationLink(destination: Text("")) {                                        VStack {                                            HStack(alignment: .center) {                                                SAGenericText(textString: array.date, textColor: Color.SAColor.colorBlack100White90, textFont: SAFontConstants.getFont(for: .regular, with: .size14))                                                Spacer()                                                HStack(alignment: .bottom, spacing: 6) {                                                    SAGenericText(textString: "Rs", textColor: Color.SAColor.colorBlack55White50, textFont: SAFontConstants.getFont(for: .regular, with: .size14))                                                        .padding(.bottom, 1)                                                    SAGenericText(textString: array.currency, textFont: SAFontConstants.interSemiBoldLargeText!)                                                }                                                Image(systemName: "chevron.right")                                                    .renderingMode(.original)                                            }                                            .padding(.bottom, 5)                                            Rectangle().fill(Color.SAColor.colorBlack10White10).frame(height: 1)                                        }                                    }                                }                                .listRowBackground(Color.clear)                                .listRowSeparator(.hidden)                            }                        }                        .frame(height: CGFloat(dataArray.count) * CGFloat(self.listRowHeight))                        .listStyle(GroupedListStyle())                    }                    .cornerRadius(7)            }        }    }}#Preview {    CurrencyHistoryView()}

Can anyone help to achive this?


Viewing all articles
Browse latest Browse all 611

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>