iPhone brightness private API not working properly

前端 未结 1 704
忘掉有多难
忘掉有多难 2021-01-20 15:09

I am trying to set the brightness of the backlight, but it\'s acting very strangely. I am using the private API:

[(id)[UIApplication sharedApplication] setBacklightL

相关标签:
1条回答
  • 2021-01-20 15:40

    The problem is that the compiler doesn't know a method takes a float unless you declare it. So the float you pass in is getting converted to another type when you pass it and then that new bit pattern being reinterpreted as a float by the method. You just need to have the method declared in a header that file knows about and the float will be passed unaltered.

    0 讨论(0)
自定义标题
段落格式
字体
字号
代码语言
提交回复
热议问题