IOS5 setBrightness didn't work with applicationWillResignActive

前端 未结 4 2127
陌清茗
陌清茗 2021-01-04 17:02

I use [[UIScreen mainScreen]setBrightness: ] (in sdk 5.0) to change the system background light in my app.

The following steps work with my app

4条回答
  •  旧时难觅i
    2021-01-04 17:47

    iOS is not meant to retain in-app brightness values. It should restore system value after the app resigns active, quits, crashes etc. So officially there is no need to do that in applicationWillResignActive.

    But it does't work. It's a bug. In fact it works if you switch to another app (press home button twice and select another app)

    Don't waste your time just file a bug report to Apple (I did well).

    Unlock screen restores default system brightness. Just press the power button twice and unlock to restore original brightness.

提交回复
热议问题