You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
| NONE | The default value for the `imageType` property. Specifies to not use an icon. Since this is the default value, you don't have to explicitly specify: `imageType: 'NONE'` in the `MenuConfig` or `MenuAction` object if you don't want to use an icon. |
230
-
| SYSTEM | Specifies that we want to a system image (i.e. like a [SF Symbols](https://developer.apple.com/design/human-interface-guidelines/sf-symbols/overview/) icon). Internally, it passes the `imageValue` string from the `MenuConfig` or `MenuAction` object like this: `UIImage(systemName: imageValue)`|
230
+
| SYSTEM | Specifies that we want to a system image (i.e. like a [SF Symbols](https://developer.apple.com/design/human-interface-guidelines/sf-symbols/overview/) icon). The `imageValue` string from a `MenuConfig` or `MenuAction` object will be used to create an `UIImage` instance: `UIImage(systemName: imageValue)`. So the `imageValue` string must correspond to an SF Symbols icon. |
231
+
| ASSET | Specifies that we want to use an image in the Xcode project's asset catalog. The `imageValue` string from a `MenuConfig` or `MenuAction` object will be used to create an `UIImage` instance: `UIImage(named: imageValue)`. So the `imageValue` string must correspond to an asset/item in the `xcasset` catalog. |
231
232
<br>
232
233
233
234
#### 3.2.2 `MenuOptions` Enum
@@ -1169,6 +1170,41 @@ class ContextMenuViewSimpleExample15 extends React.PureComponent {
1169
1170
1170
1171
<br><br>
1171
1172
1173
+
4.1.15 `ContextMenuView`[Simple Example #15](https://github.com/dominicstop/react-native-ios-context-menu/blob/master/example/src/components/ContextMenuView/ContextMenuViewSimpleExample14.js)
1174
+
A example context menu configured to have 3 menu actions. The first action has no icon, the second uses a `SYSTEM` SF Symbols icon, and the third uses a `ASSET` icon.
1175
+
* If you are using an `ASSET` icon, the the string that you pass to the `imageValue` property must correspond to an image asset in your Xcode project's `xcasset` catalog.
1176
+
<br>
1177
+
1178
+
```jsx
1179
+
<ContextMenuView
1180
+
menuConfig={{
1181
+
menuTitle:'ContextMenuViewSimpleExample16',
1182
+
menuItems: [{
1183
+
actionKey :'key-01',
1184
+
actionTitle:'Action #1',
1185
+
discoverabilityTitle:'No Icon'
1186
+
}, {
1187
+
actionKey :'key-02' ,
1188
+
actionTitle:'Action #2',
1189
+
imageType :'SYSTEM',
1190
+
imageValue :'dial.fill',
1191
+
discoverabilityTitle:'Use "SYSTEM" icon'
1192
+
1193
+
}, {
1194
+
actionKey :'key-03' ,
1195
+
actionTitle:'Action #3',
1196
+
imageType :'ASSET' ,
1197
+
imageValue :'icon-rainbow-flag',
1198
+
discoverabilityTitle:'Use "ASSET" icon'
1199
+
}],
1200
+
}}
1201
+
/>
1202
+
```
1203
+
1204
+

1205
+
1206
+
<br><br>
1207
+
1172
1208
### 4.2 `ContextMenuButton` Examples
1173
1209
Most of the examples in the `ContextMenuView` section also applies here. The props in `ContextMenuView` (like the `menuConfig` and `useActionSheetFallback` props) as well as most of the events behave the same.
0 commit comments