| 注册
请输入搜索内容

热门搜索

Java Linux MySQL PHP JavaScript Hibernate jQuery Nginx
jopen
9年前发布

iOS如何判断设备处于静音模式

-(BOOL)silenced   {       #if TARGET_IPHONE_SIMULATOR           // return NO in simulator. Code causes crashes for some reason.           return NO;       #endif        CFStringRef state;      UInt32 propertySize = sizeof(CFStringRef);      AudioSessionInitialize(NULL, NULL, NULL, NULL);      AudioSessionGetProperty(kAudioSessionProperty_AudioRoute, &propertySize;, &state;);      if(CFStringGetLength(state) > 0)              return NO;      else              return YES;  }