菜鸟教程小白 发表于 2022-12-12 15:17:54

iphone - UIImageView 动画慢


                                            <p><p>我有一个 <code>UIImageView</code> 大约有 10 个全屏 jpeg,总计大约 128k。使用 <code>setAnimationImages</code> 将这些放入 <code>UIImageView</code> 就像模拟器中的冠军一样,直到我尝试在 iPhone 上运行它导致失败。这里有什么问题吗?我认为对于我看过的所有花哨的 3D 游戏,我的蹩脚的小动画应该是实用的。</p></p>
                                    <br><hr><h1><strong>Best Answer-推荐答案</ strong></h1><br>
                                            <p><p>3D 游戏不使用 <code>UIImageView</code>,它们使用 <code>OpenGL</code>。</p>

<p>从这些来看:</p>

<p> <a href="http://www.iphonedevsdk.com/forum/iphone-sdk-development/7546-virtual-memory-leak-when-using-uiimageview-setanimationimages.html" rel="noreferrer noopener nofollow">Virtual memory leak when using UIImageView setAnimationImages?</a> </p>

<p> <a href="http://openradar.appspot.com/radar?id=330" rel="noreferrer noopener nofollow">UIImageView setAnimationImages: leaks animation array</a> </p>

<p>方法本身有问题。我建议自己加载和动画图像(创建和管理 <code>UILayer</code> 数组或简单地将 <code>UIImage</code> 切换为 <code>UIImageView</code>)。</code> p></p>
                                   
                                                <p style="font-size: 20px;">关于iphone - UIImageView 动画慢,我们在Stack Overflow上找到一个类似的问题:
                                                        <a href="https://stackoverflow.com/questions/431696/" rel="noreferrer noopener nofollow" style="color: red;">
                                                                https://stackoverflow.com/questions/431696/
                                                        </a>
                                                </p>
                                       
页: [1]
查看完整版本: iphone - UIImageView 动画慢