問題描述
Android:故事書(動畫、聲音、圖片) (Android: Storybooks (animation, sounds, pictures))
I am developing a Storybook in Android. I was surfing the net for quite some time about the possible ways on inserting multiple animated gifs in a layout. My application's features are:
‑10 story books ‑ so this means that I can't use one layout for every scenes of each story since it can cause the app to have a large file size..
‑Animation (on touch)
‑Sounds
My questions are: 1. What is the most efficient way to display multiple animated gif. I prefer using 1 layout only for several scenes (10 scenes is the minimum # of scenes per story) 2. How can I play both animation and sounds simultaneously?
I hope you can help.
Thanks!
‑‑‑‑‑
參考解法
方法 1:
I'm going to guess that this is your first Android project. Android hasn't had great support for animated GIFs and nor should they because animated GIFs are not the best way to handle animation. Even if hypothetically you could get it to work you would still have problems synchronizing sound. But to make a long story short, your question is asking how to architect your app and this isn't so straight forward because it will require a number of experimental steps. I recommend you try an animated GIF following a tutorial like this:
Animated GIF Tutorial
After you have gotten one GIF working try to extend it to multiple GIFs and then trigger it based upon touch.
(by Minisi、Cameron Lowell Palmer)