The iPhone has a set of nice transition animations which makes the experience using it very pleasant. But after a while one get so used of them that one stop noticing that they are even there. But this is not necessary a bad thing. Often I think that really good things doesn’t show at all, they don’t get in the way. In 3D application really good things make the experience so natural that one afterwards can wonder what the big deal was, really impressive 3D isn’t at all impressive. But, this is not about not noticing. After a while one maybe want to make that little extra in an iPhone app ie making a view transition more natural for the app. Some ebook readers have made page turning transitions.
I have for some time had the notion how to implement it, but as always, But frankly, nothing is really solved until it is shown to work. So, this weekend I set out to make a reusable class for a OpenGL ES based view transition animation.
My idea was basically as following
- Make a screen shot of the current view
- Create a texture of the screen shot
- Create a view with an OpenGL ES context, make it
opaque=NO
- Make it reusable with a delegate protocol for animation parts
Said and done. So how did this work? I’d say it worked pretty good. Maybe there is better ways to go from screen shot to texture but the well used screen grabbing code is solid.
UIGraphicsBeginImageContext(view.bounds.size);
[view.layer renderInContext:UIGraphicsGetCurrentContext()];
UIImage *image = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
A utility should be valued by how easy it is used. Too often I see OOP programmers making no effort at simplify a framework. Read about pseudo-classes . So how much has to be done to use this transition view? It boils down to two parts, the actual animation and the integration into Cocoa touch views. The actual animation calls are what they are, but I separated it into two delegate methods, setupTransition
and drawTransitionFrame
. Then creating the objects and make use of them can look like this (from the demo project using the Utility Application Xcode template).
- (IBAction)showInfo {
FlipsideViewController *controller = [[FlipsideViewController alloc]
initWithNibName:@"FlipsideView"
bundle:nil];
controller.delegate = self;
// Create animation delegate
DemoTransition *transition = [[[DemoTransition alloc] init] autorelease];
// Create animation view and feed the delegate
EPGLTransitionView *glview = [[[EPGLTransitionView alloc]
initWithView:self.view
delegate:transition] autorelease];
[glview startTransition];
// Animation will be run on top off next view
[self presentModalViewController:controller animated:NO];
[controller release];
}
Update: Added features to include transition into next view, grabbing next view as a texture and making it available for the drawTransitionFrame
method
Grab the source code and a Xcode demo project at github
直接上代码最直接。
相关推荐
标题中的“类似iBooks的3D仿真翻页效果”指的是在软件或应用中实现的一种模拟真实书籍翻页的视觉效果,这种效果使得电子阅读体验更加接近纸质书籍。iBooks是苹果公司开发的一款电子书阅读软件,它就采用了这种翻页...
在Android平台上,模拟iBooks电子书翻页效果是一种常见的用户界面设计,旨在提供与实体书相似的阅读体验。实现这种效果的关键在于理解图形变换和数学原理。以下将详细阐述实现这个功能所需的知识点: 首先,电子书...
除了格式支持,iBooks还提供了一些增强阅读体验的功能,例如夜间模式、字体和字号调整、页面翻转效果、书签和注释等。此外,用户还可以在不同的iOS设备之间同步阅读进度,确保无论在哪台设备上,都能继续上次中断的...
一款老版本的iBook 可供iOS6使用(界面是拟物化的)
11.Turn.js和iBooks.css组合:结合了Turn.js的翻页效果与iBooks的CSS样式,使电子书看起来更接近Apple的iBooks阅读器。 12.Pin翻页:Pin翻页提供了一种新颖的翻页方式,用户可以通过拖动页面边缘来翻页,适用于创新...
在2D场景中,通常使用CSS3的transform属性配合transition或animation来创建页面翻转效果;而在3D场景中,可能涉及到WebGL或者Three.js等3D库,通过改变物体的旋转、缩放和位置来模拟书页的翻动。 2. 技术栈: - ...
epub格式 直接导入ibooks观看 The Swift Programming Language (Swift 4)方式,....摘要居然要大于100个子,这是不是...
IBooks Author是一款功能强大的排版软件,能够提供多种模板或自建电子书,并插入多媒体内容,如音频、视频、3D物件等。使用Multi-Touch widgets可以添加交互式照片库、视频、Keynote演示文稿、3D项目等多元素。但是...
对于卷边翻页效果,我们需要使用关键帧动画来控制每一步的页面状态,比如初始页面、中间翻转状态以及完全翻转后的新页面。同时,我们还需要考虑页面的透明度、变形和旋转等属性的变化,以模拟真实翻页过程中的视觉...
**iPad上的iBooks使用指南** iBooks是一款专为iPad设计的电子书阅读应用,可以从App Store免费下载。它不仅提供出色的阅读体验,还允许用户直接在应用内购买新书。以下是如何使用iBooks的详细步骤: 1. **安装...
ibooks-亮点如果Mac上具有iBooks突出显示/注释(也应与其他iCloud设备同步),则可以使用此模块从存储于其中的晦涩sqlite数据库中提取它们。 提取JSON中的突出显示并将其分散到控制台的示例: $ npm install ibooks-...
Swift 官方中文文档20190603最新收录。
虽然与 iBooks 等应用中的 3D 翻页效果还有一定差距,但在 2D 方案中已经算是较为优秀的实现。 ### 知识点三:PageTurnerView 类的功能解析 #### 1. 类的基本结构 - `PageTurnerViewP1` 类继承自 `RelativeLayout`...
《基于iBooks,Author的电子教材设计与开发》 在信息化社会中,电子教材因其独特的富媒体性、交互性、关联性和开放性,逐渐成为教育领域的新宠。iBooks Author是苹果公司推出的一款强大的电子书制作工具,为电子教材...
为了实现更逼真的翻页效果,开发者可能还会结合Core Animation框架,利用`CALayer`的3D变形和阴影效果。例如,可以创建两个CALayer,分别代表页面的前后两面,然后通过`CATransform3DMakeRotation`函数设置不同的...
《PyPI官网下载:ibooks_highlight_exporter-0.1.11.tar.gz》 PyPI(Python Package Index)是Python编程语言的官方软件仓库,它为开发者提供了一个平台,可以发布、分享并安装第三方Python模块。在描述中提到的...
总之,通过熟练运用这些技巧,你可以在iBooks Author中创造出具有专业视觉效果的电子书,无论是背景图形的设置还是图像的精细调整,都能让内容更加引人入胜。记得持续探索和实践,提升你的电子书制作技能。
iBooks Author V2.6版本 网络上大多是从 Apple 官网转的链接,基本已经失效,无法下载 目前功能已经整合进入 Pages 当中 iBooks Author 目前仍能在 Mac OS X 10.15 之前的系统使用
ios5.01 应急修复ibooks闪退的小程序 deb格式 可用同步助手 itools等工具安装