Home IOS Development ios – Pin header in scroll view however embed components above header

ios – Pin header in scroll view however embed components above header

0
ios – Pin header in scroll view however embed components above header

[ad_1]

I want to make a scrollable view the place a component within the view is pinned to the highest. The ingredient pinned to the highest of the scroll view is just not technically the header of the view although. I need components inside the scroll view to relaxation above the header, when the person swipes downwards the weather above the header will disappear to the highest whereas the header stays pinned on the display (one thing like twitters profile view). My present code would not pin the header on the prime.

struct SwiftUIView: View {
   var physique: some View {
       ScrollView {
           LazyVStack(pinnedViews: [.sectionHeaders]) {
               Colour.blue.body(width: 50, peak: 500)
               Colour.crimson.body(width: 50, peak: 500)
               Colour.blue.body(width: 50, peak: 500)
               
               Part {
                   ScrollView {
                       //extra content material 
                   }
               } header: {
                   Textual content("My Messages")
               }
           }
       }
   }
}

[ad_2]

LEAVE A REPLY

Please enter your comment!
Please enter your name here