mirror of
https://github.com/expo/react-native-action-sheet.git
synced 2026-11-14 19:11:42 -10:00
feat: add userInterfaceStyle option for iOS (#206)
This commit is contained in:
3 files changed
+9
-3
No files matched your search
@@ -98,13 +98,17 @@ The same options available on React Native's [ActionSheetIOS](https://facebook.g
|
||||
|
||||
### iOS Only Props
|
||||
|
||||
| Name | Type | Required | Default |
|
||||
| -----------------| -------| -------- | ------- |
|
||||
| anchor | number | No | |
|
||||
| Name | Type | Required | Default |
|
||||
| -------------------| -------| -------- | ------- |
|
||||
| anchor | number | No | |
|
||||
| userInterfaceStyle | string | No | |
|
||||
|
||||
#### `anchor` (optional)
|
||||
iPad only option that allows for docking the action sheet to a node. See [ShowActionSheetButton.tsx](/example/ShowActionSheetButton.tsx) for an example on how to implement this.
|
||||
|
||||
#### `userInterfaceStyle` (optional)
|
||||
The interface style used for the action sheet, can be set to `light` or `dark`, otherwise the default system style will be used.
|
||||
|
||||
### Android/Web-Only Props
|
||||
|
||||
The below props allow modification of the Android ActionSheet. They have no effect on the look on iOS as the native iOS Action Sheet does not have options for modifying these options.
|
||||
|
||||
@@ -32,6 +32,7 @@ export default class ActionSheet extends React.Component<Props> {
|
||||
title: dataOptions.title || undefined,
|
||||
message: dataOptions.message || undefined,
|
||||
anchor: dataOptions.anchor || undefined,
|
||||
userInterfaceStyle: dataOptions.userInterfaceStyle || undefined,
|
||||
};
|
||||
ActionSheetIOS.showActionSheetWithOptions(iosOptions, onSelect);
|
||||
}
|
||||
|
||||
@@ -14,6 +14,7 @@ export interface ActionSheetIOSOptions {
|
||||
cancelButtonIndex?: number;
|
||||
destructiveButtonIndex?: number;
|
||||
anchor?: number;
|
||||
userInterfaceStyle?: 'light' | 'dark';
|
||||
}
|
||||
|
||||
// for Android or Web
|
||||
|
||||
Reference in new issue
Block a user