1
iOS6의 UITextView에 오디오 태그를 추가하는 방법이 있습니까?UITextView의 iOS6 오디오 태그
오디오 태그 란 무엇입니까?
오디오 태그는 오디오 파일을 가리키는 하이퍼 링크입니다. 오디오 태그를 클릭하면 파일이 열리고 재생됩니다.
- (BOOL)textView:(UITextView *)textView shouldInteractWithURL:(NSURL *)URL inRange:(NSRange)characterRange{
// Now deal with the url to play audio file
self.theAudio=[[AVAudioPlayer alloc] initWithContentsOfURL:(__bridge NSURL *)(URL) error:NULL];
self.theAudio.volume = 1.0;
self.theAudio.delegate = self;
[self.theAudio prepareToPlay];
[self.theAudio play];
}
는 희망이 도움이 :
** 오디오 태그 ** 하이퍼 링크 (문자열 형식)가 맞습니까? –
@KumarKl 예 오디오 태그는 하이퍼 링크이지만 텍스트 뷰에서는 언급 된 전체 경로가 필요하지 않습니다. 예를 들어 문자열 "a"는 오디오 태그에 링크 될 수 있습니다. – devmobile247