-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathv_Menu.swift
More file actions
60 lines (49 loc) · 1.6 KB
/
Copy pathv_Menu.swift
File metadata and controls
60 lines (49 loc) · 1.6 KB
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
//
// v_Menu.swift
// format
//
// Created by 1 on 7/24/22.
//
import SwiftUI
struct v_Menu: View {
var body: some View {
VStack {
Menu {
Button(action: addCurrentTabToReadingList) {
Label("添加列表", systemImage: "eyeglasses")
}
Button(action: bookmarkAll) {
Label("添加书签", systemImage: "book")
}
Button(action: show) {
Label("显示所有书签", systemImage: "books.vertical")
}
Menu("二级菜单") {
Button("Share", action: share)
}
} label: {
Label("Menu示例", systemImage: "menucard")
} primaryAction: {
addBookmark()
}
.font(.title3)
Text("说明:长按以上内容,即可看到菜单列表。iOS 16.0,新增了.menuOrder() 可以设置首选项顺序")
.font(.caption)
.foregroundColor(.gray)
.padding(EdgeInsets(top: 50, leading: 10, bottom: 0, trailing: 10))
}
.navigationTitle("Menu")
.navigationBarTitleDisplayMode(.inline)
.modifier(navBarViewCodeAndDocs(pageType: "SwiftUI",pageID: "Menu"))
}
func addCurrentTabToReadingList() {}
func addBookmark() {}
func bookmarkAll() {}
func show() {}
func share() {}
}
struct v_Menu_Previews: PreviewProvider {
static var previews: some View {
v_Menu()
}
}