first
我知道取得這個數據很無聊....
but...人生就是這個but
外國網站的作者有解釋 這是一個private api...我有寫信去apple問,是否有其他解
此連結為國外其他貢獻者,公開的一些關於外殼的顏色數據,可以看到ios6的顏色很單純用
black/white
ios 7則用色碼...如果你的手機是iphone5以上的幾種的話....
UIDevice *device = [UIDevice currentDevice]; SEL selector = NSSelectorFromString(@"deviceInfoForKey:"); if (![device respondsToSelector:selector]) { selector = NSSelectorFromString(@"_deviceInfoForKey:"); } if ([device respondsToSelector:selector]) { NSLog(@"DeviceColor: %@ DeviceEnclosureColor: %@", [device performSelector:selector withObject:@"DeviceColor"], [device performSelector:selector withObject:@"DeviceEnclosureColor"]); }
As always , if you have any question , feel free to contact me.
有任何問題,請聯絡我
歡迎轉載,請註明出處,感謝。
沒有留言:
張貼留言