Saturday, September 24, 2022
HomeiOS Developmentios - Eradicating preliminary house from ScrollView in swift UI

ios – Eradicating preliminary house from ScrollView in swift UI


I am having hassle with the preliminary place of a Scroll View in my iOS app:there is a toolbar and my scroll view is wrapped contained in the NavigationView.I wish to take away the spacing between “Testo 1” and the highest navigation bar.I’ve searched on the web however I’ve solely discovered one thing about ScrollViewReader,however really I must take away the house when the view hundreds. Is it attainable to take away that house?
Within the first picture you may see what occur once I open the app, then what seems once I scroll down

enter image description here

enter image description here

That is my code:

import SwiftUI
struct ProvaScrollView: View {
    var physique: some View {
        NavigationView(){
            
            ScrollView{
                Textual content("Testo 1")
                VStack{
                    CardView(title: "Title", textual content: "Card Textual content", colore:.blue)
                    Spacer(minLength: 10)
                    Title(testo: "Titolo 2")
                    Spacer(minLength: 3)
                    Textual content("Descrizione ")
                        .multilineTextAlignment(.middle)
                    dishImage()
                    
                }}
            .padding().toolbar(){
                ToolbarItem(placement:.navigation){
                    NavigationLink(vacation spot: ListOfRecipes()){
                        Textual content("Again")
                    }
                }
                ToolbarItem(placement:.principal){
                    Textual content("Prova Scroll View")
                        .font(.system(dimension: 20))
                        .fontWeight(.black)
                }
                
            }
            .ignoresSafeArea(.all, edges: .backside)
        }.navigationBarBackButtonHidden()
    }
    
}

Thanks prematurely

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

thirteen − 12 =

Most Popular

Recent Comments