Skip to content

Can't apply dark theme for action sheet in iOS #325

Open
@Alexeichua

Description

userInterfaceStyle: "dark" doesn't work for iOS.

Styling code is as this:

const ShowActionSheetButton = ({
imageUrl,
withTitle = false,
withMessage = false,
withIcons = false,
withSeparators = false,
withCancelButtonTintColor = false,
useModal = false,
onClose,
}) => {
const anchorRef = useRef(null);
const { showActionSheetWithOptions } = useActionSheet();

const showActionSheet = () => {
const options = ["Save", "Share", "Cancel"];
const icons = withIcons
? [icon("save"), icon("share"), icon("cancel")]
: undefined;
const titleOption = withTitle ? "Choose An Action" : undefined;
const messageOption = withMessage
? "This library tries to mimic the native share sheets as close as possible."
: undefined;
const containerStyle = {backgroundColor: "black"};
const tintColor = "white";
showActionSheetWithOptions(
{
options,
icons,
title: titleOption,
message: messageOption,
userInterfaceStyle: "dark", //Here is setting the interface, but it doesn't work
containerStyle,
tintColor,
cancelButtonIndex: 2,
showSeparators: withSeparators,
cancelButtonTintColor: withCancelButtonTintColor
? "#D93F0B"
: undefined,
useModal,
},
);
};

useEffect(() => {
if (imageUrl) {
showActionSheet();
}
}, [imageUrl]);
};

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions