I would like to remove a blank line which appears between my top title and my form. I have tried different methods without success.
Blank line between title and form
var body: some View {
NavigationView{
VStack{
ZStack{
Color(UIColor.lightGray).edgesIgnoringSafeArea(.all)
VStack(alignment: .center){
Text("Mon Parcours").font(.title).bold().padding(.top, 80).opacity(0.5).shadow(color: Color(UIColor.darkGray), radius: 1, x: 2, y: 2)
}
HStack{
Spacer()
NavigationLink(destination: NoteInfoView()) {
Image(systemName: "questionmark.circle").foregroundColor(.blue).padding(.top, 80).padding(.trailing, 10)
}}
}.frame(minWidth: 0, maxWidth: .infinity, minHeight: 0, maxHeight: 160, alignment: .topLeading).padding(.bottom,0)
VStack(alignment: .leading) {
Form{
Section(header: Text("TYPE DE BAC").bold()){
NavigationLink(destination: ListSpecialiteView(bacData:self.bacData, specialiteId:1)) {
HStack{
Text(self.bacData.selectionTypeBacId).font(.body).lineLimit(1).truncationMode(.tail)
Spacer()
Image(systemName:"r.square").resizable().frame(width: 20.0, height: 20.0).foregroundColor(.green)
}
}
}
}
}
}.navigationBarTitle("").navigationBarHidden(true).statusBar(hidden: false) }.edgesIgnoringSafeArea(.top)
}
For the first VStack
try VStack(alignment: .center, spacing: 0)
, VStack
and HStack
is adding a space between components