1.1系统提示音创建
<span style="white-space:pre"></span><p style="margin-top: 0px; margin-bottom: 0px; font-size: 18px;"><span style="font-family:KaiTi_GB2312;"><span style="color: rgb(112, 61, 170);">SystemSoundID</span> receiveSound;</span></p>NSString *soundPath = [[NSBundle mainBundle] pathForResource:@"receive_msg"
ofType:@"caf"];
NSURL *soundURL = [NSURL fileURLWithPath:soundPath];
OSStatus err = AudioServicesCreateSystemSoundID((__bridge CFURLRef)soundURL,
&receiveSound);
1.2 系统提示音播放
//播放声音
AudioServicesPlaySystemSound(receiveSound);2.1 震动提示
AudioServicesPlaySystemSound(kSystemSoundID_Vibrate);
本文详细介绍了如何在应用中创建并播放系统提示音,以及如何实现震动提示功能,包括使用Objective-C编写的代码示例。

1801

被折叠的 条评论
为什么被折叠?



