Create TimelineCollectionViewController. Make navigation bar and toolbar solid.

This commit is contained in:
Brent Simmons
2025-02-12 08:12:08 -08:00
parent 15f46206ee
commit 418fbc1763
6 changed files with 227 additions and 8 deletions

View File

@@ -61,12 +61,36 @@ final class SidebarViewController: UICollectionViewController {
super.viewDidLoad()
collectionView.backgroundColor = .systemRed
title = "Feeds"
navigationController?.navigationBar.prefersLargeTitles = true
let appearance = UINavigationBarAppearance()
appearance.configureWithOpaqueBackground() // Ensures solid background
appearance.backgroundColor = AppColor.navigationBarBackground // Set your desired color
appearance.titleTextAttributes = [.foregroundColor: UIColor.white] // Regular title text
appearance.largeTitleTextAttributes = [.foregroundColor: UIColor.white] // Large title text
appearance.shadowColor = .clear
// Apply the appearance settings
navigationController?.navigationBar.standardAppearance = appearance
navigationController?.navigationBar.scrollEdgeAppearance = appearance
navigationController?.navigationBar.compactAppearance = appearance // Optional
navigationController?.navigationBar.compactScrollEdgeAppearance = appearance
navigationController?.navigationBar.isTranslucent = false
if let subviews = navigationController?.navigationBar.subviews {
for subview in subviews {
if subview.frame.height < 2 {
subview.isHidden = true
}
}
}
navigationItem.rightBarButtonItem = filterButton
toolbar.barTintColor = AppColor.toolbarBackground
toolbar.isTranslucent = false
toolbar.translatesAutoresizingMaskIntoConstraints = false
view.addSubview(toolbar)