1.在你的项目AppDelegate类(****AppDelegate.m)里面的- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOp
tions:(NSDictionary *)launchOptions函数里加入以下代码;
[[UIApplication sharedApplication] beginReceivingRemoteCont
rolEvents];
[UIApplication sharedApplication].statusBarStyle = UIStatusBarStyleBlackTra
nslucent;
NSError *setCategoryErr = nil;
NSError *activationErr
= nil;
[[AVAudioSession sharedInstance]
setCategory: AVAudioSessionCategoryPl
ayback
error: &setCategoryErr];
[[UIApplication sharedApplication] beginReceivingRemoteCont
2.在你的“项目名-Info.plist”里面加入下面设置