TEAM LICENSES: Save money and learn new skills through a Hacking with Swift+ team license >>

How to implement Header in UITableView UIKit?

Forums > Swift

Good afternoon guys. Tell me in which direction to move to achieve such a Header with UIKit? In what direction are they moving?

And if anyone knows how to remove UINavigationBar transparency when moving a UITableView? I didn’t google anything on this issue.

2      

Hi Steven! Not really sure if I got you right, but in any case try this? Maybe this is what you want to see...

so in your viewDidLoad set up navbar as

let standard = UINavigationBarAppearance()
standard.backgroundColor = UIColor.systemRed

let compact = UINavigationBarAppearance()
compact.backgroundColor = UIColor.systemYellow

let navBar = navigationController?.navigationBar

// This property sets or returns the appearance of the
// navBar when it is displayed with STANDARD height
navBar?.standardAppearance = standard
// This property sets or returns the appearance of the
// navBar when it is displayed with COMPACT height
navBar?.compactAppearance = compact

// This property sets or returns the appearance of the
// navBar when it is displayed with STANDARD height
// and THE CONTENT IS NOT SCROLLED
navBar?.scrollEdgeAppearance = standard
// This property sets or returns the appearance of the
// navBar when it is displayed with COMPACT height
// and THE CONTENT IS NOT SCROLLED
navBar?.compactScrollEdgeAppearance = compact

2      

Thanks for the help, @ygeras. 🤓 And there you can add your own UIView?

2      

Hacking with Swift is sponsored by RevenueCat.

SPONSORED Take the pain out of configuring and testing your paywalls. RevenueCat's Paywalls allow you to remotely configure your entire paywall view without any code changes or app updates.

Learn more here

Sponsor Hacking with Swift and reach the world's largest Swift community!

But why do you need to add it on UIView? NavigationController is part of your view controller, so how is it supposed to relate to UIView? Maybe I do not see the whole picture of the challenge though...  😅

P.S. Do you need to have some view inside NavigationBar?

2      

I just haven’t encountered this in UIkit only in SwiftUI, but everything is simple there.

2      

Still not fully understood you. Can you post a pic what your are trying to solve? Is it in UIKit or SwiftUI? Yes, it UIKit it is a bit trickier than SwifUI...

2      

2      

I do not see any pic in your post... It is displayed as empty....

2      

I add link in image Figma

2      

This is how you posted.

This is what I see

PS to insert image I use Dropbox (allowed link) and then change the last bit of url (dl=0) to raw=1 then it should work

2      

Very grateful for the help and advice @ygeras. I upload pictures using Dropbox. But I decided not to do this task, I don’t have enough experience in layout of UIKit.

2      

Hacking with Swift is sponsored by RevenueCat.

SPONSORED Take the pain out of configuring and testing your paywalls. RevenueCat's Paywalls allow you to remotely configure your entire paywall view without any code changes or app updates.

Learn more here

Sponsor Hacking with Swift and reach the world's largest Swift community!

Reply to this topic…

You need to create an account or log in to reply.

All interactions here are governed by our code of conduct.

 
Unknown user

You are not logged in

Log in or create account
 

Link copied to your pasteboard.