8000
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our d 8000 ocumentation.
There was an error while loading. Please reload this page.
1 parent 5a94578 commit 3469fe5Copy full SHA for 3469fe5
IOS/LuaViewSDK/Classes/lvsdk/LVSystem.m
@@ -53,6 +53,15 @@ static int netWorkType (lv_State *L) {
53
return 1;
54
}
55
56
+// 屏幕常亮
57
+static int keepScreenOn (lv_State *L) {
58
+ if( lv_gettop(L)>0 ){
59
+ BOOL yes = lv_toboolean(L, -1);
60
+ [[UIApplication sharedApplication] setIdleTimerDisabled:yes] ;
61
+ }
62
+ return 0;
63
+}
64
+
65
static int scale (lv_State *L) {
66
CGFloat s = [UIScreen mainScreen].scale;
67
lv_pushnumber( L, s);
@@ -134,6 +143,7 @@ +(int) classDefine:(lv_State *)L {
134
143
{"ios", ios},
135
144
{"android", android},
136
145
{"network", netWorkType},
146
+ {"keepScreenOn", keepScreenOn},// 保持屏幕常亮接口
137
147
{NULL, NULL}
138
148
};
139
149
lvL_openlib(L, "System", staticFunctions, 0);
0 commit comments