跳至主内容
版本:当前版本

开发者设置

非官方测试版翻译

本页面由 PageTurner AI 翻译(测试版)。未经项目官方认可。 发现错误? 报告问题 →

DevSettings 模块提供了在开发环境中自定义开发者设置的方法。


参考

方法

addMenuItem()

tsx
static addMenuItem(title: string, handler: () => any);

向开发者菜单中添加自定义菜单项。

参数:

NameType
title
Required
string
handler
Required
function

示例:

tsx
DevSettings.addMenuItem('Show Secret Dev Screen', () => {
Alert.alert('Showing secret dev screen!');
});

reload()

tsx
static reload(reason?: string): void;

重新加载应用程序。支持直接调用或通过用户交互触发。

示例:

tsx
<Button title="Reload" onPress={() => DevSettings.reload()} />