【问题标题】:Curl animation(like open page of book) in androidandroid中的卷曲动画(如书的打开页面)
【发布时间】:2014-11-17 12:59:31
【问题描述】:

我正在开发一个包含许多图像(高清)的应用程序,这些图像将分别通过左右交换屏幕显示在下一个/上一个中。更改图像应该像打开书页(卷曲动画http://www.youtube.com/watch?v=_vOYvaNhSHw,而且在每一页上,我都必须在触摸屏幕的不同部分时播放不同的音频文件。我用谷歌搜索并找到了许多解决方案,但这些都不起作用并显示内存超出限制异常。这些网址是

  1. https://github.com/MysticTreeGames/android-page-curl
  2. https://www.youtube.com/watch?v=iwu7P5PCpsw
  3. Page curl effect in an Activity in android
  4. android taking screenshot of offscreen page
  5. http://www.youtube.com/watch?v=mP_AlvJqSLQ
  6. Android activity page curl animation
  7. make animation like page changing when swiped
  8. https://github.com/harism/android_page_curl
  9. Implement page curl on android? .... 还有更多。

在上述所有链接中,内存问题或卷曲动画最糟糕,所以我无法从他们那里获得帮助。

请帮助我摆脱这些问题。将不胜感激。

【问题讨论】:

  • 你知道android中的寻呼机
  • 感谢 Naveen,我已经尝试过寻呼机(developer.android.com/training/animation/screen-slide.html),它工作正常,但它的动画必须像打开书页一样在屏幕上左右交换,因为我们只能使用缩放 -进出,缩放动画。
  • Harism 的 curl 动画效果很好,只是如果你快速滑动有时会出现白色闪烁

标签: android android-animation page-curl


【解决方案1】:

您可以在清单中添加以下选项吗?在我的情况下,当我有大的 bitmapOutOfMemoryError 时,这对我有帮助

    android:hardwareAccelerated="true"
    android:largeHeap="true"
    android:icon="@drawable/ic_launcher_android"
    android:label="@string/app_name"
    android:theme="@style/AppTheme"

【讨论】:

  • 谢谢 Satish,我已经尝试过了。它工作正常,但应用程序的动画和流畅度(左右交换时)变得最差。
  • 我认为这是因为您使用了非常大的位图。它们会影响应用程序冻结到处理。您可以使用延迟图像加载并重试。如果有任何问题,请给我您的图像加载代码。
  • 这绝对有帮助
猜你喜欢
  • 2011-03-02
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2023-03-17
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多