Post

Replies

Boosts

Views

Activity

Reply to Remove gap between lazyvgrids in vstack
Yes, between those two lazyVgrids. I ended up adding negative padding right after the closing } of the first lazyVgrid and it removed the gap. .padding(.bottom, - 7.5) As far as a screen shot I know how to cut out a section with shift + command + 4. When I select the paper clip below and add image I select the associated png file from my desktop but I do no see it appear in this box. I clearly do not understand how to do it. Below is the section of code that includes the two lazyVgrids and the added padding. Thank you for giving me the heads up on paste and match style. It sure looks a lot cleaner. Regards, Chris LazyVGrid( columns: columns, alignment: .center, spacing: 0) { ForEach(0..<1) {row in ForEach(0..<numElementsPerArray) {col in Rectangle() .foregroundColor(.white) .overlay (Text(principalData.csvData[row][col]).bold()) .frame(height: 30) .border(Color.gray, width: 2) } } }.padding(.bottom, -7.5) ScrollView{ LazyVGrid(
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Sep ’21
Reply to Swift + OS X + Xcode : Change NavigationLink destination and text programtically
I have looked at using observable objects and adjusted my code as shown below. Xcode does not like any line with the word ObservableObject in it. The attempt I am trying to make is to change the firstPass variable so that the navigation panel in ContentView redraws. I was going also link the observable object to the NextContentView view, toggle it there then hope that the ContentView navigation panel finally redraws and shows the updated button text and NavigationLink destination. My hope is that I have made some simple stupid error. Any help would be appreciated. Chris import SwiftUI import Combine class SelectedView: ObservedObject {     @Published var firstPass : Bool = true } struct ContentView: View {          @ObservedObject var theSelection = SelectedView()          var body: some View {         NavigationView {             if (self.theSelection.firstPass){                 NavigationLink(destination: NextContentView()){                     Text ("Next View")                 }             }             else {                 NavigationLink(destination: ContentView()) {                     Text ("Previous View")                         }                 }             }     } }
Topic: Programming Languages SubTopic: Swift Tags:
Sep ’21