I'm trying to revamp the player into a floating style like Apple music. I use tabViewBottomAccessory with tabBarMinimizeBehavior. At the time, I noticed an issue that tabViewBottomAccessory would not automatically collapse when the scroll area was small (but still exceeded the screen height). tabViewBottomAccessory can only be automatically collapsed when the scroll area is large enough. Below is the simplest demo.
I'm not sure if it's intentional or if it's a bug. Besides, I wonder if we can control it programmatically(expanded/inline)?
struct ContentView: View {
var body: some View {
TabView {
Tab("Numbers", systemImage: "number.circle") {
List {
// 200 works well, but 20 not
ForEach(0..<200) { index in
Text("\(index)")
}
}
}
}
.tabBarMinimizeBehavior(.onScrollDown)
.tabViewBottomAccessory {
HStack {
Text("SwiftUI Demo App")
}
}
}
}
Selecting any option will automatically load the page
Post
Replies
Boosts
Views
Activity
In the new iOS 26 design, the navigation bar and tab bar will have a dark gradient background. We found that the color of this gradient depends on the background color of the page. For example, in the following page, our background color is green, so the navigation bar and tab bar will change the gradient to green.
Is there any way to change this gradient color?
I tried .toolbarBackground(.hidden, for: .navigationBar), but does not work。
I tried .toolbarBackground(LinearGradient(colors: [.black.opacity(0.4), .black.opacity(0)], startPoint: .top, endPoint: .bottom), for: .navigationBar), but it looks like the default gradient is the superposition of the gradient I defined, not a replacement.
Topic:
UI Frameworks
SubTopic:
SwiftUI