Change Backlight Brightness on iPhone Programmatically

后端 未结 5 1127
無奈伤痛
無奈伤痛 2020-12-01 23:15

Does the SDK provide any way to change the brightness of the backlight, or turn it off temporarily?

5条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2020-12-01 23:34

    I'm trying to do the same thing. As it happens there are a number posts out there in the internets with "solutions" for this.

    The most detailed is here This one is more succinct

    The problem is that I've tried these and they all rely on calling this function

    GSEventSetBacklightLevel();
    

    which requires this header to be imported

    #import 
    

    And that import fails in the SDK reporting that the header file cannot be found.

    I've searched for some solution but haven't found it. There is some talk about "building the toolchain" (for the best description I've found see here) but that seems to involve bypassing the SDK altogether. Pretty drastic.

    Summary: It's possible, but not with the standard iPhone SDK. I imagine an update to the SDK will come soon that should allow for it.

    Let me know if you find any other solution.

提交回复
热议问题