-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathToolBar_Example.swift
43 lines (34 loc) · 1.01 KB
/
ToolBar_Example.swift
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
//
// ToolBar_Example.swift
// Preview-Target
//
// Created by Shunzhe Ma on R 2/10/11.
//
import SwiftUI
struct ToolBar_Example: View {
var body: some View {
NavigationView {
Text("Hello world!")
.navigationTitle("ToolBar_Example")
.toolbar(content: {
// On the top left
ToolbarItem(placement: .navigationBarLeading) {
Text("ボタン")
}
// Or on the top right
ToolbarItem(placement: .navigationBarTrailing) {
Text("ボタン")
}
// Or on the bottom
ToolbarItem(placement: .bottomBar) {
Text("ボタン")
}
})
}
}
}
struct ToolBar_Example_Previews: PreviewProvider {
static var previews: some View {
ToolBar_Example()
}
}