iPhone brightness private API not working properly

前端 未结 1 701
忘掉有多难
忘掉有多难 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条回答
  •  -上瘾入骨i
    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)
提交回复
热议问题