
import SwiftUI
struct ContentView: View {
var body: some View {
NavigationStack {
VStack {
ContentUnavailableView {
Label("Adapting toolbar elements to the Liquid Glass Design System", systemImage: "tray.fill")
} description: {
Text("Explore how to design and implement toolbars in iOS 26 using Apple’s new Liquid Glass.")
.padding()
}
}
.toolbar {
ToolbarItemGroup(placement: .topBarTrailing) {
Button("Draw", systemImage: "pencil") {
// Button action here
}.glassEffect()
Button("Erase", systemImage: "eraser") {
// Button action here
}.glassEffect()
}
ToolbarSpacer(.fixed, placement: .topBarTrailing)
ToolbarItem(placement: .topBarTrailing) {
Button("Save", systemImage: "checkmark") {
// Button action here
}
.buttonStyle(.glass)
.glassEffect()
}
}
.background(Color.red)
}
}
}
#Preview {
ContentView()
}
Подробнее здесь: https://stackoverflow.com/questions/798 ... ass-effect
Мобильная версия