how to add sounds in uiscrollview,while swiping different images with different sounds. please help me. Thanks regards Rajan
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
This question already has answers here:
Closed 8 months ago.
回答1:
When scrolling stop then you can check that page is changed or not. If Changed than play sound else not.
回答2:
You have to use UIScrollViewDelegate
methods to achieve this task you can use
scrollViewDidEndDecelerating:
to achieve this with the using one ivar to store the current display position of the UIScrollView
and in this method using contentOffset.x
property of the UIScrollView
you can achieve what you need.
Yep you need to use AVAudioPlayer
to play sound.
Think this will help you.
Happy Codding :)
Enjoy Coding :)