mn-docs-mcp 0.6.2 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (222) hide show
  1. package/.trae/documents/libmn_cleanup_plan.md +51 -0
  2. package/.trae/documents/libmn_doc_restructure_plan.md +140 -0
  3. package/.trae/documents/libmn_indentation_plan.md +116 -0
  4. package/.trae/documents/libmn_title_hierarchy_plan.md +91 -0
  5. package/README.md +9 -7
  6. package/next-env.d.ts +6 -0
  7. package/next.config.mjs +14 -0
  8. package/package.json +25 -10
  9. package/postcss.config.mjs +7 -0
  10. package/scripts/sync-definitions.mjs +33 -0
  11. package/source.config.ts +5 -0
  12. package/src/app/[[...slug]]/page.tsx +259 -0
  13. package/src/app/api/search/route.ts +6 -0
  14. package/src/app/global.css +81 -0
  15. package/src/app/layout.tsx +33 -0
  16. package/src/components/JsbApiFooter.tsx +251 -0
  17. package/src/content/docs/{guides/contributing.md → contributing.md} +31 -6
  18. package/src/content/docs/{guides/cookbook → cookbook}/addon-settings.md +2 -2
  19. package/src/content/docs/{guides/cookbook → cookbook}/embed-webview-panel.md +2 -2
  20. package/src/content/docs/cookbook/meta.json +13 -0
  21. package/src/content/docs/{guides/cookbook → cookbook}/network-api-call.md +2 -2
  22. package/src/content/docs/{guides/cookbook → cookbook}/webview-bidirectional-js.md +1 -1
  23. package/src/content/docs/guides/getting-started.md +2 -2
  24. package/src/content/docs/guides/lifecycle-and-window.md +4 -4
  25. package/src/content/docs/guides/meta.json +14 -0
  26. package/src/content/docs/guides/mindmap-and-selection.md +2 -2
  27. package/src/content/docs/guides/native-ui.md +4 -4
  28. package/src/content/docs/guides/network-requests.md +8 -9
  29. package/src/content/docs/guides/notes-and-database.md +2 -2
  30. package/src/content/docs/guides/shortcut-keys.md +9 -9
  31. package/src/content/docs/guides/storage-and-files.md +4 -4
  32. package/src/content/docs/guides/toolbar-and-commands.md +1 -1
  33. package/src/content/docs/index.mdx +13 -38
  34. package/src/content/docs/libmn/data-converter.md +1572 -0
  35. package/src/content/docs/libmn/frame.md +279 -0
  36. package/src/content/docs/libmn/headers.md +234 -0
  37. package/src/content/docs/libmn/index.md +60 -0
  38. package/src/content/docs/libmn/internal-exposed.md +46 -0
  39. package/src/content/docs/libmn/locale.md +307 -0
  40. package/src/content/docs/libmn/menu.md +77 -0
  41. package/src/content/docs/libmn/meta.json +27 -0
  42. package/src/content/docs/libmn/mnbutton.md +966 -0
  43. package/src/content/docs/libmn/mncomment.md +533 -0
  44. package/src/content/docs/libmn/mnconnection.md +717 -0
  45. package/src/content/docs/libmn/mndocument.md +309 -0
  46. package/src/content/docs/libmn/mnextension-panel.md +340 -0
  47. package/src/content/docs/libmn/mnnote.md +533 -0
  48. package/src/content/docs/libmn/mnnotebook.md +725 -0
  49. package/src/content/docs/libmn/mnutil.md +2936 -0
  50. package/src/content/docs/libmn/mnwebview.md +693 -0
  51. package/src/content/docs/libmn/mustache.md +65 -0
  52. package/src/content/docs/libmn/response.md +352 -0
  53. package/src/content/docs/libmn/runtime-assets.md +64 -0
  54. package/src/content/docs/libmn/runtime-web-view-host.md +77 -0
  55. package/src/content/docs/libmn/runtime.md +178 -0
  56. package/src/content/docs/libmn/vendor-globals.md +34 -0
  57. package/src/content/docs/meta.json +11 -0
  58. package/src/content/docs/reference/black-box.md +2 -2
  59. package/src/content/docs/reference/foundation/meta.json +4 -0
  60. package/src/content/docs/reference/foundation/ns-attributed-string.md +1 -1
  61. package/src/content/docs/reference/foundation/ns-counted-set.md +1 -1
  62. package/src/content/docs/reference/foundation/ns-date-components.md +2 -2
  63. package/src/content/docs/reference/foundation/ns-date-formatter.md +1 -3
  64. package/src/content/docs/reference/foundation/ns-decimal-number.md +1 -1
  65. package/src/content/docs/reference/foundation/ns-enumerator.md +1 -1
  66. package/src/content/docs/reference/foundation/ns-error.md +2 -2
  67. package/src/content/docs/reference/foundation/ns-file-manager.md +1 -1
  68. package/src/content/docs/reference/foundation/ns-formatter.md +2 -2
  69. package/src/content/docs/reference/foundation/ns-json-serialization.md +10 -2
  70. package/src/content/docs/reference/foundation/ns-mutable-attributed-string.md +1 -1
  71. package/src/content/docs/reference/foundation/ns-mutable-character-set.md +1 -1
  72. package/src/content/docs/reference/foundation/ns-mutable-dictionary.md +1 -1
  73. package/src/content/docs/reference/foundation/ns-mutable-index-set.md +1 -1
  74. package/src/content/docs/reference/foundation/ns-mutable-set.md +1 -1
  75. package/src/content/docs/reference/foundation/ns-mutable-string.md +1 -1
  76. package/src/content/docs/reference/foundation/ns-mutable-url-request.md +2 -3
  77. package/src/content/docs/reference/foundation/ns-null.md +1 -1
  78. package/src/content/docs/reference/foundation/ns-number-formatter.md +1 -1
  79. package/src/content/docs/reference/foundation/ns-operation.md +2 -2
  80. package/src/content/docs/reference/foundation/ns-pointer-array.md +1 -1
  81. package/src/content/docs/reference/foundation/ns-proxy.md +5 -3
  82. package/src/content/docs/reference/foundation/ns-scanner.md +7 -1
  83. package/src/content/docs/reference/foundation/ns-set.md +1 -1
  84. package/src/content/docs/reference/foundation/ns-simple-c-string.md +3 -4
  85. package/src/content/docs/reference/foundation/ns-time-zone.md +1 -1
  86. package/src/content/docs/reference/foundation/ns-ubiquitous-key-value-store.md +61 -0
  87. package/src/content/docs/reference/foundation/ns-url-connection.md +2 -2
  88. package/src/content/docs/reference/foundation/ns-url-request.md +2 -2
  89. package/src/content/docs/reference/foundation/ns-url-response.md +5 -5
  90. package/src/content/docs/reference/foundation/ns-url.md +1 -1
  91. package/src/content/docs/reference/foundation/ns-user-defaults.md +5 -5
  92. package/src/content/docs/reference/foundation/ns-value.md +15 -15
  93. package/src/content/docs/reference/global/agent-tools.md +91 -0
  94. package/src/content/docs/reference/global/application.md +4 -4
  95. package/src/content/docs/reference/global/builtin-commands.md +2 -2
  96. package/src/content/docs/reference/global/database.md +4 -4
  97. package/src/content/docs/reference/global/document.md +21 -0
  98. package/src/content/docs/reference/global/global-variables.md +22 -5
  99. package/src/content/docs/reference/global/jsb.md +6 -4
  100. package/src/content/docs/reference/global/meta.json +18 -0
  101. package/src/content/docs/reference/global/note.md +2 -2
  102. package/src/content/docs/reference/global/notebook.md +21 -0
  103. package/src/content/docs/reference/global/popup-menu-item.md +2 -2
  104. package/src/content/docs/reference/global/popup-menu.md +5 -6
  105. package/src/content/docs/reference/global/search-manager.md +12 -6
  106. package/src/content/docs/reference/global/self.md +1 -13
  107. package/src/content/docs/reference/js-runtime.md +5 -4
  108. package/src/content/docs/reference/marginnote/document-controller.md +37 -5
  109. package/src/content/docs/reference/marginnote/jsextension.md +7 -7
  110. package/src/content/docs/reference/marginnote/mb-book-note.md +162 -72
  111. package/src/content/docs/reference/marginnote/mb-book.md +3 -3
  112. package/src/content/docs/reference/marginnote/mb-model-tool.md +2 -2
  113. package/src/content/docs/reference/marginnote/mb-topic.md +13 -2
  114. package/src/content/docs/reference/marginnote/meta.json +18 -0
  115. package/src/content/docs/reference/marginnote/mindmap-node.md +2 -2
  116. package/src/content/docs/reference/marginnote/mindmap-view.md +2 -2
  117. package/src/content/docs/reference/marginnote/notebook-controller.md +1 -1
  118. package/src/content/docs/reference/marginnote/outline-view.md +2 -2
  119. package/src/content/docs/reference/marginnote/reader-controller.md +1 -1
  120. package/src/content/docs/reference/marginnote/study-controller.md +19 -19
  121. package/src/content/docs/reference/meta.json +14 -0
  122. package/src/content/docs/reference/quartzcore/caanimation-group.md +3 -3
  123. package/src/content/docs/reference/quartzcore/cabasic-animation.md +3 -3
  124. package/src/content/docs/reference/quartzcore/caemitter-layer.md +44 -0
  125. package/src/content/docs/reference/quartzcore/cagradient-layer.md +1 -1
  126. package/src/content/docs/reference/quartzcore/cakeyframe-animation.md +3 -3
  127. package/src/content/docs/reference/quartzcore/calayer.md +1 -1
  128. package/src/content/docs/reference/quartzcore/camedia-timing-function.md +1 -1
  129. package/src/content/docs/reference/quartzcore/caproperty-animation.md +1 -1
  130. package/src/content/docs/reference/quartzcore/careplicator-layer.md +2 -2
  131. package/src/content/docs/reference/quartzcore/cascroll-layer.md +1 -1
  132. package/src/content/docs/reference/quartzcore/cashape-layer.md +2 -2
  133. package/src/content/docs/reference/quartzcore/catext-layer.md +4 -4
  134. package/src/content/docs/reference/quartzcore/catransaction.md +5 -3
  135. package/src/content/docs/reference/quartzcore/catransform-layer.md +3 -3
  136. package/src/content/docs/reference/quartzcore/catransition.md +10 -6
  137. package/src/content/docs/reference/quartzcore/cavalue-function.md +1 -1
  138. package/src/content/docs/reference/quartzcore/meta.json +4 -0
  139. package/src/content/docs/reference/uikit/meta.json +4 -0
  140. package/src/content/docs/reference/uikit/ns-mutable-paragraph-style.md +3 -3
  141. package/src/content/docs/reference/uikit/ns-paragraph-style.md +3 -4
  142. package/src/content/docs/reference/uikit/ns-text-storage.md +4 -5
  143. package/src/content/docs/reference/uikit/uiactivity-indicator-view.md +2 -2
  144. package/src/content/docs/reference/uikit/uiapplication.md +1 -1
  145. package/src/content/docs/reference/uikit/uibar-button-item.md +3 -4
  146. package/src/content/docs/reference/uikit/uibar-item.md +2 -3
  147. package/src/content/docs/reference/uikit/uibezier-path.md +2 -2
  148. package/src/content/docs/reference/uikit/uibutton.md +1 -1
  149. package/src/content/docs/reference/uikit/uicollection-view-cell.md +5 -5
  150. package/src/content/docs/reference/uikit/uicollection-view-controller.md +22 -2
  151. package/src/content/docs/reference/uikit/uicollection-view-flow-layout.md +54 -0
  152. package/src/content/docs/reference/uikit/uicollection-view-layout.md +9 -2
  153. package/src/content/docs/reference/uikit/uicollection-view.md +13 -4
  154. package/src/content/docs/reference/uikit/uicolor.md +1 -1
  155. package/src/content/docs/reference/uikit/uicontrol.md +3 -5
  156. package/src/content/docs/reference/uikit/uidate-picker.md +1 -1
  157. package/src/content/docs/reference/uikit/uievent.md +2 -2
  158. package/src/content/docs/reference/uikit/uifont.md +1 -1
  159. package/src/content/docs/reference/uikit/uigesture-recognizer.md +1 -1
  160. package/src/content/docs/reference/uikit/uiimage-picker-controller.md +1 -1
  161. package/src/content/docs/reference/uikit/uiimage-view.md +2 -2
  162. package/src/content/docs/reference/uikit/uiimage.md +2 -2
  163. package/src/content/docs/reference/uikit/uikey-command.md +2 -2
  164. package/src/content/docs/reference/uikit/uilabel.md +3 -3
  165. package/src/content/docs/reference/uikit/uilocal-notification.md +2 -2
  166. package/src/content/docs/reference/uikit/uilong-press-gesture-recognizer.md +2 -2
  167. package/src/content/docs/reference/uikit/uinavigation-bar.md +2 -2
  168. package/src/content/docs/reference/uikit/uinavigation-controller.md +1 -1
  169. package/src/content/docs/reference/uikit/uinavigation-item.md +1 -1
  170. package/src/content/docs/reference/uikit/uipage-control.md +1 -1
  171. package/src/content/docs/reference/uikit/uipage-view-controller.md +1 -1
  172. package/src/content/docs/reference/uikit/uipan-gesture-recognizer.md +1 -1
  173. package/src/content/docs/reference/uikit/uipasteboard.md +1 -1
  174. package/src/content/docs/reference/uikit/uipicker-view.md +3 -3
  175. package/src/content/docs/reference/uikit/uipinch-gesture-recognizer.md +1 -1
  176. package/src/content/docs/reference/uikit/uipopover-controller.md +1 -1
  177. package/src/content/docs/reference/uikit/uiresponder.md +3 -4
  178. package/src/content/docs/reference/uikit/uirotation-gesture-recognizer.md +1 -1
  179. package/src/content/docs/reference/uikit/uiscreen-mode.md +2 -2
  180. package/src/content/docs/reference/uikit/uiscrollview.md +1 -1
  181. package/src/content/docs/reference/uikit/uisearch-bar.md +25 -2
  182. package/src/content/docs/reference/uikit/uisegmented-control.md +1 -1
  183. package/src/content/docs/reference/uikit/uislider.md +1 -1
  184. package/src/content/docs/reference/uikit/uiswipe-gesture-recognizer.md +1 -1
  185. package/src/content/docs/reference/uikit/uiswitch.md +2 -2
  186. package/src/content/docs/reference/uikit/uitab-bar-controller.md +2 -2
  187. package/src/content/docs/reference/uikit/uitab-bar-item.md +1 -1
  188. package/src/content/docs/reference/uikit/uitab-bar.md +1 -1
  189. package/src/content/docs/reference/uikit/uitable-view-cell.md +6 -6
  190. package/src/content/docs/reference/uikit/uitable-view-controller.md +1 -1
  191. package/src/content/docs/reference/uikit/uitable-view.md +3 -3
  192. package/src/content/docs/reference/uikit/uitap-gesture-recognizer.md +2 -2
  193. package/src/content/docs/reference/uikit/uitext-input-mode.md +7 -3
  194. package/src/content/docs/reference/uikit/uitext-position.md +5 -5
  195. package/src/content/docs/reference/uikit/uitext-range.md +4 -4
  196. package/src/content/docs/reference/uikit/uitext-view.md +2 -2
  197. package/src/content/docs/reference/uikit/uitextfield.md +3 -3
  198. package/src/content/docs/reference/uikit/uitoolbar.md +1 -1
  199. package/src/content/docs/reference/uikit/uitouch.md +3 -3
  200. package/src/content/docs/reference/uikit/uiview-controller.md +2 -2
  201. package/src/content/docs/reference/uikit/uiview.md +5 -5
  202. package/src/content/docs/reference/uikit/uiwebview.md +5 -5
  203. package/src/content/docs/reference/uikit/uiwindow.md +2 -2
  204. package/src/content/docs/reference/utility/menu-controller.md +1 -1
  205. package/src/content/docs/reference/utility/meta.json +4 -0
  206. package/src/content/docs/reference/utility/sqlite-result-set.md +1 -1
  207. package/src/content/docs/reference/utility/sqlite-statement.md +2 -2
  208. package/src/content/docs/reference/utility/zip-archive.md +13 -14
  209. package/src/content/docs/reference/value-sturct.md +105 -0
  210. package/src/lib/layout.tsx +31 -0
  211. package/src/lib/source.ts +7 -0
  212. package/tsconfig.json +42 -3
  213. package/astro.config.mjs +0 -126
  214. package/src/client/jsb-api-footer.ts +0 -242
  215. package/src/components/Footer.astro +0 -57
  216. package/src/components/Search.astro +0 -330
  217. package/src/content.config.ts +0 -7
  218. package/src/styles/starlight-overrides.css +0 -23
  219. /package/src/content/docs/{guides/cookbook → cookbook}/append-selection-as-comment.md +0 -0
  220. /package/src/content/docs/{guides/cookbook → cookbook}/batch-rename-notes.md +0 -0
  221. /package/src/content/docs/{guides/cookbook → cookbook}/export-notebook.md +0 -0
  222. /package/src/content/docs/{guides/cookbook → cookbook}/focus-note-in-mindmap.md +0 -0
@@ -0,0 +1,966 @@
1
+ ---
2
+ title: MNButton
3
+ description: LibMN中的MNButton对象API文档。
4
+ ---
5
+
6
+ `MNButton`是封装UIButton的对象,提供按钮创建、样式设置、事件绑定和手势注册等功能,构建和管理按钮组件。
7
+
8
+ ## 构造函数
9
+
10
+ ```ts
11
+ new MNButton(config?: {})
12
+ ```
13
+
14
+ 构造一个新的MNButton实例。
15
+
16
+ | 参数名 | 类型 | 必填 | 说明 |
17
+ |:-------|:-----|:-----|:-----|
18
+ | `config` | `{}` | 否 | 配置对象。 |
19
+
20
+ ## 类成员(Class members)
21
+
22
+ ### 属性
23
+
24
+ | 字段名 | 类型 | 说明 |
25
+ |:-------|:-----|:-----|
26
+ | `highlightColor` | `UIColor` | 高亮颜色。 |
27
+ | `builtInProperty` | `string[]` | 内置属性。 |
28
+
29
+ ### 方法
30
+ #### `hexColorAlpha`
31
+
32
+ ##### 类型
33
+
34
+ ```ts
35
+ static hexColorAlpha(hex: string, alpha: number): UIColor
36
+ ```
37
+
38
+ ##### 说明
39
+
40
+ 根据十六进制颜色和透明度创建UIColor。
41
+
42
+ ##### 参数
43
+
44
+ | 参数名 | 类型 | 必填 | 说明 |
45
+ |:-------|:-----|:-----|:-----|
46
+ | `hex` | `string` | 是 | 十六进制颜色字符串。 |
47
+ | `alpha` | `number` | 是 | 透明度值。 |
48
+
49
+ ##### 返回值
50
+
51
+ - 类型:`UIColor`
52
+ - 语义:返回创建的UIColor对象。
53
+ #### `hexColor`
54
+
55
+ ##### 类型
56
+
57
+ ```ts
58
+ static hexColor(hex: string): UIColor
59
+ ```
60
+
61
+ ##### 说明
62
+
63
+ 根据十六进制颜色创建UIColor。
64
+
65
+ ##### 参数
66
+
67
+ | 参数名 | 类型 | 必填 | 说明 |
68
+ |:-------|:-----|:-----|:-----|
69
+ | `hex` | `string` | 是 | 十六进制颜色字符串。 |
70
+
71
+ ##### 返回值
72
+
73
+ - 类型:`UIColor`
74
+ - 语义:返回创建的UIColor对象。
75
+ #### `setColor`
76
+
77
+ ##### 类型
78
+
79
+ ```ts
80
+ static setColor(button: UIButton, hexColor: string, alpha?: number): void
81
+ ```
82
+
83
+ ##### 说明
84
+
85
+ 设置按钮颜色。
86
+
87
+ ##### 参数
88
+
89
+ | 参数名 | 类型 | 必填 | 说明 |
90
+ |:-------|:-----|:-----|:-----|
91
+ | `button` | `UIButton` | 是 | 按钮对象。 |
92
+ | `hexColor` | `string` | 是 | 十六进制颜色字符串。 |
93
+ | `alpha` | `number` | 否 | 透明度值。 |
94
+
95
+ ##### 返回值
96
+
97
+ - 类型:`void`
98
+ - 语义:无返回值。
99
+ #### `setTitle`
100
+
101
+ ##### 类型
102
+
103
+ ```ts
104
+ static setTitle(button: UIButton, title: string, font?: number, bold?: boolean): void
105
+ ```
106
+
107
+ ##### 说明
108
+
109
+ 设置按钮标题。
110
+
111
+ ##### 参数
112
+
113
+ | 参数名 | 类型 | 必填 | 说明 |
114
+ |:-------|:-----|:-----|:-----|
115
+ | `button` | `UIButton` | 是 | 按钮对象。 |
116
+ | `title` | `string` | 是 | 标题文本。 |
117
+ | `font` | `number` | 否 | 字体大小。 |
118
+ | `bold` | `boolean` | 否 | 是否粗体。 |
119
+
120
+ ##### 返回值
121
+
122
+ - 类型:`void`
123
+ - 语义:无返回值。
124
+ #### `setImage`
125
+
126
+ ##### 类型
127
+
128
+ ```ts
129
+ static setImage(button: UIButton, path: string|NSData): void
130
+ ```
131
+
132
+ ##### 说明
133
+
134
+ 设置按钮图像。
135
+
136
+ ##### 参数
137
+
138
+ | 参数名 | 类型 | 必填 | 说明 |
139
+ |:-------|:-----|:-----|:-----|
140
+ | `button` | `UIButton` | 是 | 按钮对象。 |
141
+ | `path` | `string\|NSData` | 是 | 图像路径或NSData对象。 |
142
+
143
+ ##### 返回值
144
+
145
+ - 类型:`void`
146
+ - 语义:无返回值。
147
+ #### `setOpacity`
148
+
149
+ ##### 类型
150
+
151
+ ```ts
152
+ static setOpacity(button: UIButton, opacity: number): void
153
+ ```
154
+
155
+ ##### 说明
156
+
157
+ 设置按钮透明度。
158
+
159
+ ##### 参数
160
+
161
+ | 参数名 | 类型 | 必填 | 说明 |
162
+ |:-------|:-----|:-----|:-----|
163
+ | `button` | `UIButton` | 是 | 按钮对象。 |
164
+ | `opacity` | `number` | 是 | 透明度值。 |
165
+
166
+ ##### 返回值
167
+
168
+ - 类型:`void`
169
+ - 语义:无返回值。
170
+ #### `setRadius`
171
+
172
+ ##### 类型
173
+
174
+ ```ts
175
+ static setRadius(button: UIButton, radius?: number): void
176
+ ```
177
+
178
+ ##### 说明
179
+
180
+ 设置按钮圆角半径。
181
+
182
+ ##### 参数
183
+
184
+ | 参数名 | 类型 | 必填 | 说明 |
185
+ |:-------|:-----|:-----|:-----|
186
+ | `button` | `UIButton` | 是 | 按钮对象。 |
187
+ | `radius` | `number` | 否 | 圆角半径。 |
188
+
189
+ ##### 返回值
190
+
191
+ - 类型:`void`
192
+ - 语义:无返回值。
193
+ #### `setConfig`
194
+
195
+ ##### 类型
196
+
197
+ ```ts
198
+ static setConfig(button: UIButton, config: { color: string, alpha: number, opacity: number, radius: number }): void
199
+ ```
200
+
201
+ ##### 说明
202
+
203
+ 设置按钮配置。
204
+
205
+ ##### 参数
206
+
207
+ | 参数名 | 类型 | 必填 | 说明 |
208
+ |:-------|:-----|:-----|:-----|
209
+ | `button` | `UIButton` | 是 | 按钮对象。 |
210
+ | `config` | `{ color: string, alpha: number, opacity: number, radius: number }` | 是 | 配置对象。 |
211
+
212
+ ##### 返回值
213
+
214
+ - 类型:`void`
215
+ - 语义:无返回值。
216
+ #### `addClickAction`
217
+
218
+ ##### 类型
219
+
220
+ ```ts
221
+ static addClickAction(button: UIButton, target: object, selector: string): void
222
+ ```
223
+
224
+ ##### 说明
225
+
226
+ 添加点击动作。
227
+
228
+ ##### 参数
229
+
230
+ | 参数名 | 类型 | 必填 | 说明 |
231
+ |:-------|:-----|:-----|:-----|
232
+ | `button` | `UIButton` | 是 | 按钮对象。 |
233
+ | `target` | `object` | 是 | 目标对象。 |
234
+ | `selector` | `string` | 是 | 选择器方法名。 |
235
+
236
+ ##### 返回值
237
+
238
+ - 类型:`void`
239
+ - 语义:无返回值。
240
+ #### `addPanGesture`
241
+
242
+ ##### 类型
243
+
244
+ ```ts
245
+ static addPanGesture(button: UIButton, target: object, selector: string): void
246
+ ```
247
+
248
+ ##### 说明
249
+
250
+ 添加平移手势。
251
+
252
+ ##### 参数
253
+
254
+ | 参数名 | 类型 | 必填 | 说明 |
255
+ |:-------|:-----|:-----|:-----|
256
+ | `button` | `UIButton` | 是 | 按钮对象。 |
257
+ | `target` | `object` | 是 | 目标对象。 |
258
+ | `selector` | `string` | 是 | 选择器方法名。 |
259
+
260
+ ##### 返回值
261
+
262
+ - 类型:`void`
263
+ - 语义:无返回值。
264
+ #### `addLongPressGesture`
265
+
266
+ ##### 类型
267
+
268
+ ```ts
269
+ static addLongPressGesture(button: UIButton, target: object, selector: string): void
270
+ ```
271
+
272
+ ##### 说明
273
+
274
+ 添加长按手势。
275
+
276
+ ##### 参数
277
+
278
+ | 参数名 | 类型 | 必填 | 说明 |
279
+ |:-------|:-----|:-----|:-----|
280
+ | `button` | `UIButton` | 是 | 按钮对象。 |
281
+ | `target` | `object` | 是 | 目标对象。 |
282
+ | `selector` | `string` | 是 | 选择器方法名。 |
283
+
284
+ ##### 返回值
285
+
286
+ - 类型:`void`
287
+ - 语义:无返回值。
288
+ #### `addSwipeGesture`
289
+
290
+ ##### 类型
291
+
292
+ ```ts
293
+ static addSwipeGesture(button: UIButton, target: object, selector: string): void
294
+ ```
295
+
296
+ ##### 说明
297
+
298
+ 添加滑动手势。
299
+
300
+ ##### 参数
301
+
302
+ | 参数名 | 类型 | 必填 | 说明 |
303
+ |:-------|:-----|:-----|:-----|
304
+ | `button` | `UIButton` | 是 | 按钮对象。 |
305
+ | `target` | `object` | 是 | 目标对象。 |
306
+ | `selector` | `string` | 是 | 选择器方法名。 |
307
+
308
+ ##### 返回值
309
+
310
+ - 类型:`void`
311
+ - 语义:无返回值。
312
+
313
+ ## 实例成员(Instance members)
314
+
315
+ ### 属性
316
+
317
+ | 字段名 | 类型 | 说明 |
318
+ |:-------|:-----|:-----|
319
+ | `superview` | `UIView` | 父视图。 |
320
+ | `frame` | `CGRect` | 框架。 |
321
+ | `bounds` | `CGRect` | 边界。 |
322
+ | `center` | `CGPoint` | 中心点。 |
323
+ | `window` | `UIWindow\|undefined` | 窗口。 |
324
+ | `gestureRecognizers` | `NSArray<UIGestureRecognizer>\|UIGestureRecognizer[]\|undefined` | 手势识别器。 |
325
+ | `borderColor` | `CGColor` | 边框颜色。 |
326
+ | `borderWidth` | `number` | 边框宽度。 |
327
+ | `backgroundColor` | `UIColor` | 背景颜色。 |
328
+ | `color` | `UIColor\|string` | 颜色。 |
329
+ | `colorString` | `string` | 颜色字符串。 |
330
+ | `hidden` | `boolean` | 是否隐藏。 |
331
+ | `autoresizingMask` | `number` | 自动调整掩码。 |
332
+ | `opacity` | `number` | 透明度。 |
333
+ | `radius` | `number` | 圆角半径。 |
334
+ | `cornerRadius` | `number` | 圆角半径。 |
335
+ | `currentTitle` | `string` | 当前标题。 |
336
+ | `title` | `string` | 标题。 |
337
+ | `currentTitleColor` | `UIColor` | 当前标题颜色。 |
338
+ | `currentTitleColorString` | `string` | 当前标题颜色字符串。 |
339
+ | `titleColor` | `UIColor` | 标题颜色。 |
340
+ | `titleColorString` | `string` | 标题颜色字符串。 |
341
+ | `currentImage` | `UIImage` | 当前图像。 |
342
+ | `subviews` | `NSArray<UIView>\|UIView[]` | 子视图。 |
343
+ | `font` | `UIFont` | 字体。 |
344
+ | `masksToBounds` | `boolean` | 是否裁剪到边界。 |
345
+
346
+ ### 方法
347
+
348
+ #### `setFrame`
349
+
350
+ ##### 类型
351
+
352
+ ```ts
353
+ setFrame(x: number, y: number, width: number, height: number): void
354
+ ```
355
+
356
+ ##### 说明
357
+
358
+ 设置按钮的位置和尺寸。
359
+
360
+ ##### 参数
361
+
362
+ | 参数名 | 类型 | 必填 | 说明 |
363
+ |:-------|:-----|:-----|:-----|
364
+ | `x` | `number` | 是 | x坐标。 |
365
+ | `y` | `number` | 是 | y坐标。 |
366
+ | `width` | `number` | 是 | 宽度。 |
367
+ | `height` | `number` | 是 | 高度。 |
368
+
369
+ ##### 返回值
370
+
371
+ - 类型:`void`
372
+ - 语义:无返回值。
373
+
374
+ #### `setColor`
375
+
376
+ ##### 类型
377
+
378
+ ```ts
379
+ setColor(hexColor: string, alpha?: number): void
380
+ ```
381
+
382
+ ##### 说明
383
+
384
+ 设置按钮颜色。
385
+
386
+ ##### 参数
387
+
388
+ | 参数名 | 类型 | 必填 | 说明 |
389
+ |:-------|:-----|:-----|:-----|
390
+ | `hexColor` | `string` | 是 | 十六进制颜色字符串。 |
391
+ | `alpha` | `number` | 否 | 透明度值。 |
392
+
393
+ ##### 返回值
394
+
395
+ - 类型:`void`
396
+ - 语义:无返回值。
397
+
398
+ #### `setImageForState`
399
+
400
+ ##### 类型
401
+
402
+ ```ts
403
+ setImageForState(image: UIImage, state?: number): void
404
+ ```
405
+
406
+ ##### 说明
407
+
408
+ 为指定状态设置按钮图像。
409
+
410
+ ##### 参数
411
+
412
+ | 参数名 | 类型 | 必填 | 说明 |
413
+ |:-------|:-----|:-----|:-----|
414
+ | `image` | `UIImage` | 是 | 图像对象。 |
415
+ | `state` | `number` | 否 | 按钮状态。 |
416
+
417
+ ##### 返回值
418
+
419
+ - 类型:`void`
420
+ - 语义:无返回值。
421
+
422
+ #### `setImage`
423
+
424
+ ##### 类型
425
+
426
+ ```ts
427
+ setImage(image: UIImage, state?: number): void
428
+ ```
429
+
430
+ ##### 说明
431
+
432
+ 设置按钮图像。
433
+
434
+ ##### 参数
435
+
436
+ | 参数名 | 类型 | 必填 | 说明 |
437
+ |:-------|:-----|:-----|:-----|
438
+ | `image` | `UIImage` | 是 | 图像对象。 |
439
+ | `state` | `number` | 否 | 按钮状态。 |
440
+
441
+ ##### 返回值
442
+
443
+ - 类型:`void`
444
+ - 语义:无返回值。
445
+
446
+ #### `setTitleColorForState`
447
+
448
+ ##### 类型
449
+
450
+ ```ts
451
+ setTitleColorForState(color: UIColor, state?: number): void
452
+ ```
453
+
454
+ ##### 说明
455
+
456
+ 为指定状态设置标题颜色。
457
+
458
+ ##### 参数
459
+
460
+ | 参数名 | 类型 | 必填 | 说明 |
461
+ |:-------|:-----|:-----|:-----|
462
+ | `color` | `UIColor` | 是 | 颜色对象。 |
463
+ | `state` | `number` | 否 | 按钮状态。 |
464
+
465
+ ##### 返回值
466
+
467
+ - 类型:`void`
468
+ - 语义:无返回值。
469
+
470
+ #### `setTitleColor`
471
+
472
+ ##### 类型
473
+
474
+ ```ts
475
+ setTitleColor(color: UIColor, state?: number): void
476
+ ```
477
+
478
+ ##### 说明
479
+
480
+ 设置标题颜色。
481
+
482
+ ##### 参数
483
+
484
+ | 参数名 | 类型 | 必填 | 说明 |
485
+ |:-------|:-----|:-----|:-----|
486
+ | `color` | `UIColor` | 是 | 颜色对象。 |
487
+ | `state` | `number` | 否 | 按钮状态。 |
488
+
489
+ ##### 返回值
490
+
491
+ - 类型:`void`
492
+ - 语义:无返回值。
493
+
494
+ #### `setTitleForState`
495
+
496
+ ##### 类型
497
+
498
+ ```ts
499
+ setTitleForState(title: string, state?: number): void
500
+ ```
501
+
502
+ ##### 说明
503
+
504
+ 为指定状态设置标题。
505
+
506
+ ##### 参数
507
+
508
+ | 参数名 | 类型 | 必填 | 说明 |
509
+ |:-------|:-----|:-----|:-----|
510
+ | `title` | `string` | 是 | 标题文本。 |
511
+ | `state` | `number` | 否 | 按钮状态。 |
512
+
513
+ ##### 返回值
514
+
515
+ - 类型:`void`
516
+ - 语义:无返回值。
517
+
518
+ #### `setTitle`
519
+
520
+ ##### 类型
521
+
522
+ ```ts
523
+ setTitle(title: string, state?: number): void
524
+ ```
525
+
526
+ ##### 说明
527
+
528
+ 设置按钮标题。
529
+
530
+ ##### 参数
531
+
532
+ | 参数名 | 类型 | 必填 | 说明 |
533
+ |:-------|:-----|:-----|:-----|
534
+ | `title` | `string` | 是 | 标题文本。 |
535
+ | `state` | `number` | 否 | 按钮状态。 |
536
+
537
+ ##### 返回值
538
+
539
+ - 类型:`void`
540
+ - 语义:无返回值。
541
+
542
+ #### `addSubview`
543
+
544
+ ##### 类型
545
+
546
+ ```ts
547
+ addSubview(view: UIView): void
548
+ ```
549
+
550
+ ##### 说明
551
+
552
+ 添加子视图。
553
+
554
+ ##### 参数
555
+
556
+ | 参数名 | 类型 | 必填 | 说明 |
557
+ |:-------|:-----|:-----|:-----|
558
+ | `view` | `UIView` | 是 | 子视图对象。 |
559
+
560
+ ##### 返回值
561
+
562
+ - 类型:`void`
563
+ - 语义:无返回值。
564
+
565
+ #### `removeFromSuperview`
566
+
567
+ ##### 类型
568
+
569
+ ```ts
570
+ removeFromSuperview(): void
571
+ ```
572
+
573
+ ##### 说明
574
+
575
+ 从父视图中移除。
576
+
577
+ ##### 返回值
578
+
579
+ - 类型:`void`
580
+ - 语义:无返回值。
581
+
582
+ #### `bringSubviewToFront`
583
+
584
+ ##### 类型
585
+
586
+ ```ts
587
+ bringSubviewToFront(view: UIView): void
588
+ ```
589
+
590
+ ##### 说明
591
+
592
+ 将子视图移到最前面。
593
+
594
+ ##### 参数
595
+
596
+ | 参数名 | 类型 | 必填 | 说明 |
597
+ |:-------|:-----|:-----|:-----|
598
+ | `view` | `UIView` | 是 | 子视图对象。 |
599
+
600
+ ##### 返回值
601
+
602
+ - 类型:`void`
603
+ - 语义:无返回值。
604
+
605
+ #### `sendSubviewToBack`
606
+
607
+ ##### 类型
608
+
609
+ ```ts
610
+ sendSubviewToBack(view: UIView): void
611
+ ```
612
+
613
+ ##### 说明
614
+
615
+ 将子视图移到最后面。
616
+
617
+ ##### 参数
618
+
619
+ | 参数名 | 类型 | 必填 | 说明 |
620
+ |:-------|:-----|:-----|:-----|
621
+ | `view` | `UIView` | 是 | 子视图对象。 |
622
+
623
+ ##### 返回值
624
+
625
+ - 类型:`void`
626
+ - 语义:无返回值。
627
+
628
+ #### `isDescendantOfView`
629
+
630
+ ##### 类型
631
+
632
+ ```ts
633
+ isDescendantOfView(view: UIView): boolean
634
+ ```
635
+
636
+ ##### 说明
637
+
638
+ 判断是否是指定视图的后代。
639
+
640
+ ##### 参数
641
+
642
+ | 参数名 | 类型 | 必填 | 说明 |
643
+ |:-------|:-----|:-----|:-----|
644
+ | `view` | `UIView` | 是 | 父视图对象。 |
645
+
646
+ ##### 返回值
647
+
648
+ - 类型:`boolean`
649
+ - 语义:返回是否是后代视图。
650
+
651
+ #### `isDescendantOfStudyView`
652
+
653
+ ##### 类型
654
+
655
+ ```ts
656
+ isDescendantOfStudyView(): boolean
657
+ ```
658
+
659
+ ##### 说明
660
+
661
+ 判断是否是学习视图的后代。
662
+
663
+ ##### 返回值
664
+
665
+ - 类型:`boolean`
666
+ - 语义:返回是否是学习视图的后代。
667
+
668
+ #### `isDescendantOfCurrentWindow`
669
+
670
+ ##### 类型
671
+
672
+ ```ts
673
+ isDescendantOfCurrentWindow(): boolean
674
+ ```
675
+
676
+ ##### 说明
677
+
678
+ 判断是否是当前窗口的后代。
679
+
680
+ ##### 返回值
681
+
682
+ - 类型:`boolean`
683
+ - 语义:返回是否是当前窗口的后代。
684
+
685
+ #### `setNeedsLayout`
686
+
687
+ ##### 类型
688
+
689
+ ```ts
690
+ setNeedsLayout(): void
691
+ ```
692
+
693
+ ##### 说明
694
+
695
+ 标记需要重新布局。
696
+
697
+ ##### 返回值
698
+
699
+ - 类型:`void`
700
+ - 语义:无返回值。
701
+
702
+ #### `layoutIfNeeded`
703
+
704
+ ##### 类型
705
+
706
+ ```ts
707
+ layoutIfNeeded(): void
708
+ ```
709
+
710
+ ##### 说明
711
+
712
+ 立即执行布局。
713
+
714
+ ##### 返回值
715
+
716
+ - 类型:`void`
717
+ - 语义:无返回值。
718
+
719
+ #### `layoutSubviews`
720
+
721
+ ##### 类型
722
+
723
+ ```ts
724
+ layoutSubviews(): void
725
+ ```
726
+
727
+ ##### 说明
728
+
729
+ 布局子视图。
730
+
731
+ ##### 返回值
732
+
733
+ - 类型:`void`
734
+ - 语义:无返回值。
735
+
736
+ #### `setNeedsDisplay`
737
+
738
+ ##### 类型
739
+
740
+ ```ts
741
+ setNeedsDisplay(): void
742
+ ```
743
+
744
+ ##### 说明
745
+
746
+ 标记需要重新显示。
747
+
748
+ ##### 返回值
749
+
750
+ - 类型:`void`
751
+ - 语义:无返回值。
752
+
753
+ #### `sizeThatFits`
754
+
755
+ ##### 类型
756
+
757
+ ```ts
758
+ sizeThatFits(size: CGSize): CGSize
759
+ ```
760
+
761
+ ##### 说明
762
+
763
+ 计算适合的尺寸。
764
+
765
+ ##### 参数
766
+
767
+ | 参数名 | 类型 | 必填 | 说明 |
768
+ |:-------|:-----|:-----|:-----|
769
+ | `size` | `CGSize` | 是 | 建议尺寸。 |
770
+
771
+ ##### 返回值
772
+
773
+ - 类型:`CGSize`
774
+ - 语义:返回适合的尺寸。
775
+
776
+ #### `addTargetActionForControlEvents`
777
+
778
+ ##### 类型
779
+
780
+ ```ts
781
+ addTargetActionForControlEvents(target: object, action: string, controlEvent: UIControlEvents): void
782
+ ```
783
+
784
+ ##### 说明
785
+
786
+ 为控制事件添加目标动作。
787
+
788
+ ##### 参数
789
+
790
+ | 参数名 | 类型 | 必填 | 说明 |
791
+ |:-------|:-----|:-----|:-----|
792
+ | `target` | `object` | 是 | 目标对象。 |
793
+ | `action` | `string` | 是 | 动作方法名。 |
794
+ | `controlEvent` | `UIControlEvents` | 是 | 控制事件。 |
795
+
796
+ ##### 返回值
797
+
798
+ - 类型:`void`
799
+ - 语义:无返回值。
800
+
801
+ #### `removeTargetActionForControlEvents`
802
+
803
+ ##### 类型
804
+
805
+ ```ts
806
+ removeTargetActionForControlEvents(target: object, action: string, controlEvent: UIControlEvents): void
807
+ ```
808
+
809
+ ##### 说明
810
+
811
+ 移除控制事件的目标动作。
812
+
813
+ ##### 参数
814
+
815
+ | 参数名 | 类型 | 必填 | 说明 |
816
+ |:-------|:-----|:-----|:-----|
817
+ | `target` | `object` | 是 | 目标对象。 |
818
+ | `action` | `string` | 是 | 动作方法名。 |
819
+ | `controlEvent` | `UIControlEvents` | 是 | 控制事件。 |
820
+
821
+ ##### 返回值
822
+
823
+ - 类型:`void`
824
+ - 语义:无返回值。
825
+
826
+ #### `addClickAction`
827
+
828
+ ##### 类型
829
+
830
+ ```ts
831
+ addClickAction(target: object, selector: string): void
832
+ ```
833
+
834
+ ##### 说明
835
+
836
+ 添加点击动作。
837
+
838
+ ##### 参数
839
+
840
+ | 参数名 | 类型 | 必填 | 说明 |
841
+ |:-------|:-----|:-----|:-----|
842
+ | `target` | `object` | 是 | 目标对象。 |
843
+ | `selector` | `string` | 是 | 选择器方法名。 |
844
+
845
+ ##### 返回值
846
+
847
+ - 类型:`void`
848
+ - 语义:无返回值。
849
+
850
+ #### `addGestureRecognizer`
851
+
852
+ ##### 类型
853
+
854
+ ```ts
855
+ addGestureRecognizer(gestureRecognizer: UIGestureRecognizer): void
856
+ ```
857
+
858
+ ##### 说明
859
+
860
+ 添加手势识别器。
861
+
862
+ ##### 参数
863
+
864
+ | 参数名 | 类型 | 必填 | 说明 |
865
+ |:-------|:-----|:-----|:-----|
866
+ | `gestureRecognizer` | `UIGestureRecognizer` | 是 | 手势识别器对象。 |
867
+
868
+ ##### 返回值
869
+
870
+ - 类型:`void`
871
+ - 语义:无返回值。
872
+
873
+ #### `removeGestureRecognizer`
874
+
875
+ ##### 类型
876
+
877
+ ```ts
878
+ removeGestureRecognizer(gestureRecognizer: UIGestureRecognizer): void
879
+ ```
880
+
881
+ ##### 说明
882
+
883
+ 移除手势识别器。
884
+
885
+ ##### 参数
886
+
887
+ | 参数名 | 类型 | 必填 | 说明 |
888
+ |:-------|:-----|:-----|:-----|
889
+ | `gestureRecognizer` | `UIGestureRecognizer` | 是 | 手势识别器对象。 |
890
+
891
+ ##### 返回值
892
+
893
+ - 类型:`void`
894
+ - 语义:无返回值。
895
+
896
+ #### `addPanGesture`
897
+
898
+ ##### 类型
899
+
900
+ ```ts
901
+ addPanGesture(target: object, selector: string): void
902
+ ```
903
+
904
+ ##### 说明
905
+
906
+ 添加平移手势。
907
+
908
+ ##### 参数
909
+
910
+ | 参数名 | 类型 | 必填 | 说明 |
911
+ |:-------|:-----|:-----|:-----|
912
+ | `target` | `object` | 是 | 目标对象。 |
913
+ | `selector` | `string` | 是 | 选择器方法名。 |
914
+
915
+ ##### 返回值
916
+
917
+ - 类型:`void`
918
+ - 语义:无返回值。
919
+
920
+ #### `addLongPressGesture`
921
+
922
+ ##### 类型
923
+
924
+ ```ts
925
+ addLongPressGesture(target: object, selector: string): void
926
+ ```
927
+
928
+ ##### 说明
929
+
930
+ 添加长按手势。
931
+
932
+ ##### 参数
933
+
934
+ | 参数名 | 类型 | 必填 | 说明 |
935
+ |:-------|:-----|:-----|:-----|
936
+ | `target` | `object` | 是 | 目标对象。 |
937
+ | `selector` | `string` | 是 | 选择器方法名。 |
938
+
939
+ ##### 返回值
940
+
941
+ - 类型:`void`
942
+ - 语义:无返回值。
943
+
944
+ #### `addSwipeGesture`
945
+
946
+ ##### 类型
947
+
948
+ ```ts
949
+ addSwipeGesture(target: object, selector: string): void
950
+ ```
951
+
952
+ ##### 说明
953
+
954
+ 添加滑动手势。
955
+
956
+ ##### 参数
957
+
958
+ | 参数名 | 类型 | 必填 | 说明 |
959
+ |:-------|:-----|:-----|:-----|
960
+ | `target` | `object` | 是 | 目标对象。 |
961
+ | `selector` | `string` | 是 | 选择器方法名。 |
962
+
963
+ ##### 返回值
964
+
965
+ - 类型:`void`
966
+ - 语义:无返回值。