applicationWillResignActive and setBrightness not working?

后端 未结 6 1170
误落风尘
误落风尘 2021-01-03 20:17

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:

  1. Act

6条回答
  •  说谎
    说谎 (楼主)
    2021-01-03 21:13

    I answered a similar question here: IOS5 setBrightness didn't work with applicationWillResignActive

    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 try to switch to another app. Try pressing Home button twice and your brightness is gone.

    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.

    UPDATE: My bug report was closed because according to Apple it's not a bug. It is weird.

提交回复
热议问题